dynamic_app_icon
A Flutter plugin to dynamically change your appβs icon at runtime on iOS and Android.
Users just need to add icons to assets/icons/
, run the generator script, and the plugin handles everything.
β¨ Features
- Change app icons programmatically
- Supports multiple icons
- Android alias setup automated
- iOS alternate icons handled automatically
- Generator script to create native entries (AndroidManifest + Info.plist)
- Example app included
πΈ Video Demo
Hereβs how it works in action π
(Converted from assets/demo.mov
β keep both in repo for reference)
πΌοΈ Screenshots
π Getting Started
1. Install the plugin
dependencies:
dynamic_app_icon: ^1.0.0
2. Add your icons
Place your icons in:
assets/icons/
ββ icon1.png
ββ icon2.png
ββ icon3.png
And declare in pubspec.yaml
:
flutter:
assets:
- assets/icons/
3. Run the generator
dart run tool/generate_icons.dart
This script will:
- Update AndroidManifest.xml with
<activity-alias>
- Update Info.plist with alternate icons
- Generate
lib/generated_icons.dart
andGeneratedIcons.kt
π± Usage
import 'package:dynamic_app_icon/dynamic_app_icon.dart';
import 'package:dynamic_app_icon/generated_icons.dart';
await DynamicAppIcon.setIcon("icon2"); // switch to icon2
await DynamicAppIcon.resetIcon(); // reset to default
print(GeneratedIcons.available); // list of available icons
π Example
Check the example/ app for a working demo.
π οΈ Platform Support
- β Android
- β iOS
- β Web (not supported)
π License
This project is licensed under the MIT License - see the LICENSE file for details.