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 πŸ‘‡

Demo

(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 and GeneratedIcons.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.