0 purchases
banuba arcloud
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
copied to clipboard
Import in Dart code to access plugin functionalities.
import 'package:banuba_arcloud/banuba_arcloud.dart';
copied to clipboard
Usage #
BanubaARCloudPlugin is the main class responsible for all interactions with AR Cloud.
First, create new instance.
final plugin = BanubaARCloudPlugin();
copied to clipboard
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) => ...,
);
copied to clipboard
Set your AR Cloud url. Normally this url is provided by Banuba representatives.
final arCloudUrl = '';
plugin.init(arCloudUrl: arCloudUrl);
copied to clipboard
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();
}
copied to clipboard
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
}
copied to clipboard
Dispose plugin when you complete interaction with AR Cloud.
@override
void dispose() {
_effectsStreamSubscription.cancel();
_plugin.dispose();
super.dispose();
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.