lockScreen method

  1. @override
Future<String> lockScreen({
  1. String imageName = "myimage",
  2. ImageFormat fileExtension = ImageFormat.jpeg,
  3. double width = 0,
  4. double height = 0,
  5. RequestSizeOptions options = RequestSizeOptions.resizeFit,
  6. 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;
}