instance property
WallpaperManagerFlutterPlatform
get
instance
The default instance of WallpaperManagerFlutterPlatform to use.
This is the default platform implementation used by the plugin. By default, it is set to MethodChannelWallpaperManagerFlutter.
Use this to access the platform-specific code and invoke methods like setWallpaper
.
Example usage:
bool result = await WallpaperManagerFlutterPlatform.instance.setWallpaper(imageFile, location);
Implementation
static WallpaperManagerFlutterPlatform get instance => _instance;
set
instance
(WallpaperManagerFlutterPlatform instance)
Platform-specific implementations should set this with their own platform-specific class that extends WallpaperManagerFlutterPlatform when they register themselves.
This method allows users to set a custom platform-specific implementation (e.g., for Android, iOS). Example:
WallpaperManagerFlutterPlatform.instance = CustomWallpaperManagerFlutter();
Implementation
static set instance(WallpaperManagerFlutterPlatform instance) {
PlatformInterface.verifyToken(instance, _token);
_instance = instance;
}