Prerequisites
- A working Flutter quickstart
- A compatible background-blur
.nosmaipackage
Apply the blur package
The current public Dart model exposes color, image, and video constructors for manual background replacement. Use an authored background package for blur:
final backgrounds =
await NosmaiFlutter.instance.getLocalBackgrounds();
final blur = backgrounds.firstWhere(
(item) => item.name == 'background_blur',
);
await NosmaiFlutter.instance.applyEffect(blur.path);
Use the actual name or identifier supplied with your package. Do not hard-code background_blur unless that is the asset shipped by the application.
Remove it
await NosmaiFlutter.instance.removeEffect(blur);
Verify it worked
The subject should stay visible while the authored package blurs the background. The same preview widget must remain mounted.
Common errors
| Symptom | Fix |
|---|---|
| Local list is empty | Confirm the package is bundled and refresh local filter discovery |
applyEffect returns false | Use the discovered local path and verify the package against the native release |
| Blur package replaces another background | This is expected because both use the background slot |