lockScreen method
Future<String>
lockScreen({
- String imageName = "myimage",
- ImageFormat fileExtension = ImageFormat.jpeg,
- double width = 0,
- double height = 0,
- RequestSizeOptions options = RequestSizeOptions.resizeFit,
- DownloadLocation location = DownloadLocation.temporaryDirectory,
override
bothScreenis to set home and lock screen
imageName -> Name of the downloaded image to set as home screen
width and height -> send the width and height to use while setting the image as wallpaper else will use the entire image as it is
options to use when setting wallpaper RESIZE_FIT, RESIZE_INSIDE, RESIZE_EXACT,RESIZE_CENTRE_CROP
location where the image is downloaded
Implementation
@override
Future<String> lockScreen({
String imageName = "myimage",
ImageFormat fileExtension = ImageFormat.jpeg,
double width = 0,
double height = 0,
RequestSizeOptions options = RequestSizeOptions.resizeFit,
DownloadLocation location = DownloadLocation.temporaryDirectory,
}) async {
final String resultvar = await methodChannel.invokeMethod('LockScreen', {
'maxWidth': width,
'maxHeight': height,
'RequestSizeOptions': options.index,
'location': location.index,
'imageName': imageName,
'fileExtension': _imageFormatToExtension(fileExtension),
});
return resultvar;
}