banuba_arcloud 1.0.3 copy "banuba_arcloud: ^1.0.3" to clipboard
banuba_arcloud: ^1.0.3 copied to clipboard

Our AR Cloud service enables your app to connect with our servers and access AR effects directly from the cloud.

Banuba ARCloud plugin #

AR Cloud is a client-server solution that helps to save space in your application. This is a product used to store AR filters i.e. masks on a server-side instead of the SDK code. After being selected by the user for the first time, the filter is going to be downloaded from the server and then saved on the phone's memory.

Requirements #

Android #

  • minSdkVersion 23
  • Kotlin 1.7.20

Installing #

Add banuba_arcloud in your pubspec.yaml file.

dependencies:
  flutter:
    sdk: flutter
    banuba_arcloud: ^1.0.3

Import in Dart code to access plugin functionalities.

import 'package:banuba_arcloud/banuba_arcloud.dart';

Usage #

BanubaARCloudPlugin is the main class responsible for all interactions with AR Cloud.

First, create new instance.

final plugin = BanubaARCloudPlugin();

Listen to any effects changes using getEffectsStream() method. List of effects contains local(stored in the local database) and remote(stored on AR Cloud) effects. The callback is called when

  • effects are loaded from local database
  • effects are loaded from AR Cloud
  • effect is downloaded
final effectsStreamSubscription = plugin.getEffectsStream().listen(
_onEffectsLoaded,
onError: (e) => ...,
);

Set your AR Cloud url. Normally this url is provided by Banuba representatives.

 final arCloudUrl = '';
 plugin.init(arCloudUrl: arCloudUrl);

Load effects from AR Cloud. New list of effects will be pushed when effects are loaded from AR Cloud successfully.

Future<void> _loadEffects() async {
  await plugin.loadEffects();
}

Download effect. New list of effects will be pushed to the stream when the effect is downloaded.

try {
await plugin.downloadEffect(effect.name);
} on Exception catch (e) {
// handle exception
}

Dispose plugin when you complete interaction with AR Cloud.

 @override
  void dispose() {
    _effectsStreamSubscription.cancel();
    _plugin.dispose();
    super.dispose();
  }
1
likes
130
points
93
downloads

Publisher

unverified uploader

Weekly Downloads

Our AR Cloud service enables your app to connect with our servers and access AR effects directly from the cloud.

Homepage

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on banuba_arcloud