Skip to content

Instantly share code, notes, and snippets.

@divyanshub024
Created September 8, 2019 09:23
Show Gist options
  • Save divyanshub024/afc15441dd8336309857379f284d8f13 to your computer and use it in GitHub Desktop.
Save divyanshub024/afc15441dd8336309857379f284d8f13 to your computer and use it in GitHub Desktop.
Future<void> _setWallpaper(int wallpaperType) async {
var file =
await DefaultCacheManager().getSingleFile(widget.model.largeImageURL);
try {
final int result = await platform
.invokeMethod('setWallpaper', [file.path, wallpaperType]);
print('Wallpaer Updated.... $result');
} on PlatformException catch (e) {
print("Failed to Set Wallpaer: '${e.message}'.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment