Search code examples
androiddartflutterwallpaper

Android's Wallpapermanager in Flutter?


I am writing an app for Android in Flutter that sets the user's wallpaper. I am having trouble finding how to do this, as Flutter is made to compile to both iOS and Android apps, and iOS doesn't allow apps to set a wallpaper. In Android, one can use the WallpaperManager. Is there some way I can call this in Flutter, or is there some equivalent? I don't mind losing iOS compatibility, I just want it to work on Android.


Solution

  • Yes, flutter has platform-channel which allows you to call native code via flutter.

    You can take a look at this flutter example that shows how to implement a platform channel in flutter.

    Hope that helps!