πŸ“± wallpaper_manager_plus

A modern, lightweight Flutter plugin to set wallpapers on Android Home Screen, Lock Screen, or both. Supports static images and live video wallpapers. Built for performance, reliability, and large image support.


πŸ”” Why Choose wallpaper_manager_plus?

βœ… Built using Kotlin coroutines to handle wallpaper setting in a background thread β€” effectively preventing ANR (Application Not Responding) issues common in older implementations.

βœ… Perfect for developers building wallpaper apps, personalization tools, or utilities requiring dynamic background changes.

πŸ“£ Have a feature request or bug to report? Open an issue or contribute via pull request!


πŸš€ Key Features

  • 🏠 Set wallpaper on Home Screen, Lock Screen, or Both
  • 🎬 Set Live Wallpapers using video files (MP4)
  • πŸ–ΌοΈ Seamless support for large images
  • πŸ’Ύ Works with cached network images and local files
  • ⚑ Lightweight and easy to integrate
  • πŸ”„ Compatible with Flutter null safety and latest Dart versions

πŸ“¦ Installation

Add to your pubspec.yaml:

dependencies:
  wallpaper_manager_plus: ^any

Import it in your Dart file:

import 'package:wallpaper_manager_plus/wallpaper_manager_plus.dart';

πŸ› οΈ How to Use

πŸ”Ή Set Wallpaper from Cached Network Image

To set a wallpaper from a remote image URL using caching, integrate the flutter_cache_manager:

Step 1: Add dependency

dependencies:
  flutter_cache_manager: ^any

Step 2: Import packages

import 'dart:io';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:wallpaper_manager_plus/wallpaper_manager_plus.dart';

Step 3: Example code

try {
  String imageUrl = 'https://example.com/image.jpg';
  File file = await DefaultCacheManager().getSingleFile(imageUrl);

  await WallpaperManagerPlus().setWallpaper(
    file,
    WallpaperManagerPlus.homeScreen,
  );
} catch (e) {
  print('Error: $e');
}

πŸ”Ή Set Wallpaper from Local File

Use a file from local storage:

try {
  File imageFile = File('/storage/emulated/0/Download/image.png');

  await WallpaperManagerPlus().setWallpaper(
    imageFile,
    WallpaperManagerPlus.homeScreen,
  );
} catch (e) {
  print('Error: $e');
}

πŸ”Ή Set Live Wallpaper (Video)

Set a video file as a live wallpaper. The system wallpaper picker will open for manual confirmation.

From Local File:

try {
  File videoFile = File('/storage/emulated/0/Download/video.mp4');
  
  await WallpaperManagerPlus().setLiveWallpaper(videoFile);
} catch (e) {
  print('Error: $e');
}

Download and Set from URL:

import 'package:flutter_cache_manager/flutter_cache_manager.dart';

try {
  String videoUrl = 'https://www.pexels.com/download/video/7121778/';
  File videoFile = await DefaultCacheManager().getSingleFile(videoUrl);
  
  await WallpaperManagerPlus().setLiveWallpaper(videoFile);
} catch (e) {
  print('Error: $e');
}

πŸ“Œ User interaction is required to complete the wallpaper setup through the system picker.


πŸ“· Demo

A small demo GIF included in this repository (see gifs/wallpaper.gif):

Wallpaper demo


πŸ’‘ Full Example

Check out the example/ directory for a complete working example.


🀝 Contribute to Development

We welcome your contributions! If you want to:

  • Add new features
  • Fix bugs
  • Improve documentation

Fork the repository and submit a pull request. Every contribution helps!