homeScreen method
Future<String>
homeScreen({
- String imageName = "myimage",
- ImageFormat fileExtension = ImageFormat.jpeg,
- double width = 0,
- double height = 0,
- RequestSizeOptions options = RequestSizeOptions.resizeFit,
- DownloadLocation location = DownloadLocation.temporaryDirectory,
override
homeScreen is to set home 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> homeScreen(
{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('HomeScreen', {
'maxWidth': width,
'maxHeight': height,
'RequestSizeOptions': options.index,
'location': location.index,
'imageName': imageName,
'fileExtension': _imageFormatToExtension(fileExtension)
});
return resultvar;
}