Prerequisites
- A working Flutter quickstart
- A compatible background-blur filter available through Cloud Filters
Download and apply the blur
Request the background catalog, select the blur filter, and download it before applying it:
final backgrounds = await NosmaiFlutter.instance.getCloudFilters(
filterType: NosmaiCloudFilterType.background,
page: 1,
limit: 20,
);
final blur = backgrounds.firstWhere(
(item) => item.name == 'background_blur',
);
final download = await NosmaiFlutter.instance.downloadCloudFilter(
blur.cloudIdentifier,
);
final blurPath = download['path'] as String?;
if (blurPath == null || blurPath.isEmpty) {
throw StateError('Background blur download failed');
}
await NosmaiFlutter.instance.applyEffect(blurPath);
Use the actual name or identifier returned by the Cloud Filter catalog.
Remove it
await NosmaiFlutter.instance.removeAllFilters();
Verify it worked
The subject should stay visible while the selected Cloud Filter blurs the background. The same preview widget must remain mounted.
Common errors
| Symptom | Fix |
|---|---|
| Cloud Filter catalog is empty | Check the project configuration and selected Cloud Filter category |
applyEffect returns false | Use the successful Cloud Filter download result and verify native versions |
| Blur filter replaces another background | This is expected because both use the background slot |