desktop_wallpaper_set

A new Flutter plugin for wallpaper set.

Usage

To use this plugin, add desktop_wallpaper_set as a dependency in your pubspec.yaml file.

Example

import 'package:desktop_wallpaper_set/desktop_wallpaper_set.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:desktop_wallpaper_set/type.dart';
final _desktopWallpaperSetPlugin = DesktopWallpaperSet();

void main() {
  runApp(Scaffold(
    body: Center(
      child: ElevatedButton(
        onPressed: onSetWallpaper,
        child: Text('set wallpaper')
      ),
    ),
  ));
}


onSetWallpaper() async {
  final file = await DefaultCacheManager().getSingleFile(
        "http://i0.hdslb.com/bfs/baselabs/d8e091a5be327e2a24fa62f794281448a2010f7f.png");
  await _desktopWallpaperSetPlugin.setWallpaper(file.path, WallpaperType.img);
}

onSetVideoWallpaper() async {
  final file = await DefaultCacheManager().getSingleFile(
        "https://activity.hdslb.com/blackboard/static/20220829/a370089fc7c797ab7a9d638df8c9cbf7/PaGtZVhRco.mp4");
  await _desktopWallpaperSetPlugin.setWallpaper(file.path, WallpaperType.video);
}