flutter_wallpaper_plus library
Flutter Wallpaper Plus — Production-grade wallpaper plugin for Android.
Set image and video (live) wallpapers from assets, files, and URLs with intelligent caching, thumbnail generation, toast customization, and structured error handling.
Quick Start
import 'package:flutter_wallpaper_plus/flutter_wallpaper_plus.dart';
// Set image wallpaper from URL
final result = await FlutterWallpaperPlus.setImageWallpaper(
source: WallpaperSource.url('https://example.com/bg.jpg'),
target: WallpaperTarget.both,
);
if (result.success) {
print('Done!');
} else {
print('Error: ${result.errorCode}');
}
Video Wallpaper
final result = await FlutterWallpaperPlus.setVideoWallpaper(
source: WallpaperSource.asset('assets/live_bg.mp4'),
target: WallpaperTarget.home,
enableAudio: false,
loop: true,
);
Thumbnail Generation
final thumbnail = await FlutterWallpaperPlus.getVideoThumbnail(
source: WallpaperSource.url('https://example.com/video.mp4'),
quality: 50,
);
if (thumbnail != null) {
Image.memory(thumbnail);
}
Classes
- FlutterWallpaperPlus
- Primary API for setting wallpapers on Android.
- TargetSupportPolicy
- Device-specific target support policy reported by the Android layer.
- WallpaperAutoChangeStatus
- Current status of the wallpaper auto change engine.
- WallpaperResult
- Structured result from any wallpaper operation.
- WallpaperSource
- Immutable descriptor for where wallpaper content comes from.
Enums
- WallpaperErrorCode
- Structured error codes for precise programmatic error handling.
- WallpaperSourceType
- Defines how wallpaper content is sourced.
- WallpaperTarget
- Specifies which screen(s) to apply the wallpaper to.
Extensions
- WallpaperErrorCodeParsing on WallpaperErrorCode
- Extension to safely parse error code strings from the platform layer.