import 'package:wallpaper_handler/wallpaper_handler.dart';
import 'package:wallpaperx/common/components/easy_loading.dart';
import 'package:wallpaperx/common/utils/log_print.dart';

class WallpaperManage {
  static void setWallpaper(String imgPath, int location) {
    WallpaperLocation wallpaperLocation = WallpaperLocation.homeScreen;
    switch (location) {
      case 0:
        wallpaperLocation = WallpaperLocation.homeScreen;
        break;
      case 1:
        wallpaperLocation = WallpaperLocation.lockScreen;
        break;
      case 2:
        wallpaperLocation = WallpaperLocation.bothScreens;
        break;
    }
    // WallpaperHandler.instance
    //     .setWallpaperFromFile(imgPath, wallpaperLocation)
    //     .then((res) {
    //   LogPrint.d("result====$res");
    //   toast(res ? 'Wallpaper set' : 'Failed to get wallpaper.');
    // }).catchError((e) {
    //   LogPrint.d("error====$e");
    // });
  }
}
