सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
वॉलपेपर मैनेजर एक फ्लटर प्लगइन है जो डेवलपर्स को एंड्रॉइड डिवाइस पर होम स्क्रीन, लॉक स्क्रीन या दोनों वॉलपेपर को कार्यक्रमानुसार सेट करने की अनुमति देता है। यह फ्लटर ऐप के भीतर सीधे छवियों को वॉलपेपर के रूप में लागू करने के लिए एक सरल इंटरफ़ेस प्रदान करता है, जिससे फोटो या कस्टमाइज़ेशन ऐप्स में उपयोगकर्ता अनुभव को बढ़ाया जा सकता है। प्लगइन मूल एंड्रॉइड API का उपयोग करता है और वर्तमान में केवल एंड्रॉइड के लिए समर्थित है, आईओएस के लिए कोई कार्यान्वयन नहीं है। इसमें उचित अनुमतियाँ की आवश्यकता होती है और व्यक्तिगत अनुकूलन, छवि गैलरी या डिजिटल कला प्रदर्शन के लिए डिज़ाइन किए गए ऐप्स में सबसे अच्छा काम करता है।
उपयोग
एप्लिकेशन कंटेंट से डायनामिक वॉलपेपर सेट करें
वॉलपेपर फीचर के साथ फोटो गैलरी ऐप बनाना
लाइफस्टाइल ऐप में उपयोगकर्ता कस्टमाइज़ेशन सक्षम करना
डिजिटल आर्ट प्लेटफॉर्म में वॉलपेपर बदलावों को एकीकृत करना
मुख्य विशेषताएँ
होम स्क्रीन वॉलपेपर सेट करें
लॉक स्क्रीन वॉलपेपर सेट करें
दोनों स्क्रीन के लिए समर्थन
Flutter के साथ सरल API एकीकरण
मूल एंड्रॉइड वॉलपेपर API का उपयोग करता है
इनके लिए उपयुक्त
Android-केवल ऐप्स जिनमें वॉलपेपर बदलने की आवश्यकता है
फोटो और कला साझाकरण एप्लिकेशन
उपयोगकर्ता व्यक्तिगत उपकरण
डायनामिक बैकग्राउंड थीम वाले ऐप्स
विचार योग्य बातें
केवल एंड्रॉइड डिवाइस के लिए उपलब्ध
रनटाइम अनुमति के मांग की आवश्यकता है
Android के वॉलपेपर प्रणाली तक सीमित
iOS का समर्थन नहीं करता है
चित्र रिज़ॉल्यूशन और प्रारूप के संभालने की आवश्यकता हो सकती है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
wallpaper_manager
A Flutter plugin for changing the Home Screen, Lock Screen (or both) Wallpaper(s) on Android devices.
Usage
Installation
In the pubspec.yaml of your flutter project, add the following dependency:
Since this is not a Widget, you have to create WallpaperManager constructors from inside an async function, which is a Future that returns a String output specifying success/failure.
String path = "/path/to/file/on/disk";
int location = WallpaperManager.HOME_SCREEN; // or location = WallpaperManager.LOCK_SCREEN;finalString result = awaitWallpaperManager.setWallpaperFromFile(path, location);
Basic Usage with error handling
You might want to wrap it in a try/catch since platform messages (plug-ins like these) may fail
String path = "/path/to/file/on/disk";
int location = WallpaperManager.HOME_SCREEN; // or location = WallpaperManager.LOCK_SCREEN;String result;
try {
result = awaitWallpaperManager.setWallpaperFromFile(path, location);
} onPlatformException {
result = 'Failed to get wallpaper.';
}
Loading from a URL (with CacheManager, the image is saved to app files as well)
If you're loading a Wallpaper from a URL, you should save it to the disk first, then use the path of the saved image file.
Add flutter_cache_manager or any other dependency you'd like:
dependencies:...flutter_cache_manager:"^1.1.3"
And in dart code
String url = "";
int location = WallpaperManager.HOME_SCREEN; // or location = WallpaperManager.LOCK_SCREEN;String result;
var file = awaitDefaultCacheManager().getSingleFile(url);
finalString result = awaitWallpaperManager.setWallpaperFromFile(file.path, location);
Loading from a Flutter asset
If you're loading a Wallpaper from an asset, you need to make sure it is indexed in the pubspec.yaml file first
String assetPath = "assets/tmp1.jpg";
int location = WallpaperManager.HOME_SCREEN; // or location = WallpaperManager.LOCK_SCREEN;String result;
finalString result = awaitWallpaperManager.setWallpaperFromAsset(assetPath, location);
Getting started
With Wallpaper Manager
See the example directory for a complete sample app using Wallpaper Manager.
With Flutter
For help getting started with Flutter, view the online documentation.
Notes
iOS does not support changing Wallpapers from third-party apps (Source)
Xiaomi/MIUI does not support changing Lock Screen Wallpapers directly from the Android API (Source). You might want to look at creating a Lock Screen Launcher app instead.
[x] Add rect values for optionally cropping the image
[ ] Add variable for re-using Wallpaper from phone's settings
[ ] Write more tests
Changelog
Please see the Changelog page to know what's recently changed.
Contributions
Feel free to contribute to this project.
If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.