Package selection guidance compiled from public package information, community data, and project usage.
A Flutter plugin that enables dynamic app icon changes and batch number updates on Android and iOS. It allows developers to programmatically switch the app's icon at runtime, useful for custom branding, seasonal themes, or user preferences. The plugin supports both platform-specific icon management and batch numbering for versioning or promotional purposes. Designed for seamless integration with Flutter apps, it simplifies icon manipulation without requiring native code changes. Ideal for apps needing visual flexibility or interactive icon experiences.
Use cases
Changing app icon based on user preference
Seasonal or event-based icon updates
App branding customization
Testing different icon variants
Promotional campaign icon switching
Key features
Dynamic icon switching at runtime
Support for Android and iOS
Batch number management
Simple API integration
No native code required
Suitable for
Apps with customizable UI
Branding-focused applications
Event-driven or seasonal apps
Developer tools for icon testing
Marketing or promotional campaigns
Considerations
Requires app restart after icon change
Limited support on some older devices
iOS requires additional configuration
Icon assets must be pre-defined
Not suitable for frequent icon changes
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
flutter_dynamic_icon
A flutter plugin for dynamically changing app icon and app icon batch number in the mobile platform. Supports only iOS (with version > 10.3).
Check out the example directory for a sample app using flutter_dynamic_icon.
iOS Integration
Index
2x - 120px x 120px
3x - 180px x 180px
To integrate your plugin into the iOS part of your app, follow these steps
First let us put a few images for app icons, they are
teamfortress@2x.png, teamfortress@3x.png
photos@2x.png, photos@3x.png,
chills@2x.png, chills@3x.png,
These icons shouldn't be kept in Assets.xcassets folder, but outside. When copying to Xcode, you can select 'create folder references' or 'create groups', if not you will get and error when uploading the build to the AppStore saying: (Thanks to @nohli for this observation)
TMS-90032: Invalid Image Path - - No image found at the path referenced under key 'CFBundleAlternateIcons':...
Here is my directory structure:
Next, we need to setup the Info.plist
Add Icon files (iOS 5) to the Information Property List
Add CFBundleAlternateIcons as a dictionary, it is used for alternative icons
Set 3 dictionaries under CFBundleAlternateIcons, they are correspond to teamfortress, photos, and chills
For each dictionary, two properties — UIPrerenderedIcon and CFBundleIconFiles need to be configured
If the sub-property UINewsstandIcon is showing under Icon files (iOS 5) and you don't plan on using it (it is intended for use with Newstand features), erase it or the app will get rejected upon submission on the App Store
Note that if you need it work for iPads, You need to add these icon declarations in CFBundleIcons~ipad as well. See here for more details.
Here is my Info.plist after adding Alternate Icons
Now, you can call FlutterDynamicIcon.setAlternateIconName with the CFBundleAlternateIcons key as the argument to set that icon.
Dart/Flutter Integration
From your Dart code, you need to import the plugin and use it's static methods:
import'package:flutter_dynamic_icon/flutter_dynamic_icon.dart';
try {
if (awaitFlutterDynamicIcon.supportsAlternateIcons) {
awaitFlutterDynamicIcon.setAlternateIconName("photos");
print("App icon change successful");
return;
}
} onPlatformException {} catch (e) {}
print("Failed to change app icon");
...
// set batch numbertry {
awaitFlutterDynamicIcon.setApplicationIconBadgeNumber(9399);
} onPlatformException {} catch (e) {}
// gets currently set batch numberint batchNumber = FlutterDynamicIcon.getApplicationIconBadgeNumber();
Check out the example app for more details
Screenrecord
Showing App Icon change
Showing Batch number on app icon change in SpringBoard
Reference
This was made possible because this blog. I borrowed a lot of words from this blog.
https://medium.com/ios-os-x-development/dynamically-change-the-app-icon-7d4bece820d2