Prerequisites
- A working Flutter quickstart
- A compatible AR mask available through Cloud Filters
Obtain the mask
Select and download a compatible AR mask through Cloud Filters.
Apply it
final masks = await NosmaiFlutter.instance.getCloudFilters(
filterType: NosmaiCloudFilterType.effects,
page: 1,
limit: 20,
);
final mask = masks.first;
final download = await NosmaiFlutter.instance.downloadCloudFilter(
mask.cloudIdentifier,
);
final maskPath = download['path'] as String?;
if (maskPath == null || maskPath.isEmpty) {
throw StateError('AR mask download failed');
}
final applied = await NosmaiFlutter.instance.applyEffect(maskPath);
if (!applied) {
throw StateError('AR mask could not be applied');
}
Keep NosmaiCameraPreview mounted while changing Cloud Filters.
Remove it
await NosmaiFlutter.instance.removeAllFilters();
Verify it worked
Move out of frame and return. The mask should follow its configured face-found and face-lost behaviour.
Common errors
| Symptom | Fix |
|---|---|
| Cloud Filter catalog is empty | Check the project configuration and selected Cloud Filter category |
Apply returns false | Use the successful download result and verify native versions |