wallpaper_manager_flutter
एंड्रॉइड पर होम, लॉक स्क्रीन या दोनों के लिए वॉलपेपर सेट करने के लिए एक फ्लटर प्लगइन। बड़े छवियों के लिए भी तेज और कुशल।
एक उच्च प्रदर्शन वाला Flutter प्लगइन जो आपको Android डिवाइस पर कार्यक्रमात्मक रूप से वॉलपेपर सेट करने की अनुमति देता है। उच्च-रिज़ॉल्यूशन छवियों के साथ भी यूआई फ्रीज़ होने के बिना होम स्क्रीन, लॉक स्क्रीन या दोनों पर छवियाँ सेट करें। सरल API, कुशल छवि प्रसंस्करण और व्यापक त्रुटि हैंडलिंग।
{"sdk":"flutter"}^2.0.2{"sdk":"flutter"}^5.0.0यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
A powerful Flutter plugin that enables you to programmatically set wallpapers. This plugin maintains smooth performance even with high-resolution wallpapers. Easily customize home screen, lock screen, or both screens with just a few lines of code!
A simple demonstration of setting wallpapers without any lag or freezing
Add this to your package's pubspec.yaml file:
dependencies:
wallpaper_manager_flutter: ^latest_version
First, import the package:
import 'package:wallpaper_manager_flutter/wallpaper_manager_flutter.dart';
You can set wallpapers for different screens using the following constants:
// Create instance
final wallpaperManager = WallpaperManagerFlutter();
// Available options for wallpaper location: homeScreen, lockScreen & bothScreens
// Example: Set wallpaper on home screen
try {
File imageFile = File('path_to_your_image.jpg');
bool result = await wallpaperManager.setWallpaper(
imageFile,
WallpaperManagerFlutter.homeScreen,
);
if (result) {
print('Wallpaper set successfully! 🎉');
}
} catch (e) {
print('Error setting wallpaper: $e ❌');
}
The plugin includes comprehensive error handling. Here are some common errors you might encounter:
Always wrap the setWallpaper call in a try-catch block to handle potential errors gracefully.
| Platform | Support | Notes |
|---|---|---|
| Android | ✅ | Full support for home screen, lock screen, and both screens |
| iOS | ❌ | Not supported due to iOS system security restrictions. |
Note: Requires Android 7.0 (API level 24) or higher.
Contributions are welcome! If you have a bug fix or new feature, please create a pull request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
If you find this plugin helpful, please give it a star ⭐ on GitHub and consider following me for more useful Flutter plugins!
For any issues, feature requests, or questions, please create an issue on GitHub.