wallpaper_manager_flutter

Creator: coderz1093

Last updated:

Add to Cart

Description:

wallpaper manager flutter

wallpaper_manager_flutter #
A Plugin to set Wallpaper of HomeScreen,LockScreen and Both Screen without lag even for large images.
Installation #
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
wallpaper_manager_flutter: ^0.0.2
copied to clipboard
In your dart file add the following import:
import 'package:wallpaper_manager_flutter/wallpaper_manager_flutter.dart';
copied to clipboard
Usage #
Set Wallpaper from cache file #
You can use flutter_cache_manager package to access the cached image files,
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
flutter_cache_manager: ^3.1.2
copied to clipboard
In your dart file add the following import:
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
copied to clipboard
Now pass the image url to the cache manager and await cachedimage and then pass the cached image to the plugin.
Use this inside an async function.
String url = ''; // Image url

String cachedimage = await DefaultCacheManager().getSingleFile(url); //image file

int location = WallpaperManagerFlutter.HOME_SCREEN; //Choose screen type

WallpaperManagerFlutter().setwallpaperfromFile(cachedimage, location); // Wrap with try catch for error management.
copied to clipboard
Check the Example file for Better Understanding.
Set wallpaper from system file #
Use this inside an async Function,
imagefile = /0/images/image.png,

location = WallpaperManagerFlutter.HOME_SCREEN //Choose screen type

WallpaperManagerFlutter().setwallpaperwithFile(imagefile, location);
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.