setWallpaper method

  1. @override
Future<bool?> setWallpaper(
  1. String imagePath
)
override

Implementation

@override
Future<bool?> setWallpaper(String imagePath) async {
  try {
    final result = await methodChannel.invokeMethod<bool>(
      'setWallpaper',
      {'imagePath': imagePath},
    );
    return result;
  } on PlatformException catch (e) {
    debugPrint('Wallpaper o\'rnatishda xatolik: ${e.message}');
    return false;
  }
}