I want to change my app's icon from inside app in Android and iOS. How can I achieve this to my app
Asked
Active
Viewed 2,469 times
0
-
1I found this only package flutter_dynamic_icon on pub.dev to achieve this feature. – Ujjawal Maurya Feb 17 '22 at 12:11
-
Did you try this? https://stackoverflow.com/questions/1103027/how-to-change-an-application-icon-programmatically-in-android – Dan Baruch Feb 17 '22 at 12:14
-
any other ways to do in Android and iOS both – Ujjawal Maurya Feb 17 '22 at 12:29
2 Answers
1
This flutter_dynamic_icon package can help. For me it worked on iOS
just add it flutter_dynamic_icon: ^2.0.0
to your project and do some changes accordingly
iOS configurations(I found only iOS): (If anyone found Android Configs please share with us)
Add icon images (here.png
)
Add some lines in info.plist
(>> Raw info.plist <<)
Dart code sample:
import 'package:flutter_dynamic_icon/flutter_dynamic_icon.dart';
try {
if (await FlutterDynamicIcon.supportsAlternateIcons) {
await FlutterDynamicIcon.setAlternateIconName("photos");
print("App icon change successful");
return;
}
} on PlatformException {} catch (e) {}
print("Failed to change app icon");
...
// set batch number
try {
await FlutterDynamicIcon.setApplicationIconBadgeNumber(9399);
} on PlatformException {} catch (e) {}
// gets currently set batch number
int batchNumber = FlutterDynamicIcon.getApplicationIconBadgeNumber();
Check this repo out for detailed explanation
flutter dynamic icon

Ujjawal Maurya
- 462
- 5
- 17
-
-
On which platform you are trying to achieve this. This only works on iOS as of now, Android support is yet to come – Ujjawal Maurya Apr 09 '22 at 06:23
-
-
-
it always hits this - print("Failed to change app icon"); it's never successful in my simulator. – Luke Irvin Apr 11 '22 at 15:43
-
It does not work in apple silicon emulator Mac machines. Try to run in a real device will work – kike Oct 26 '22 at 14:34
0
you can use this package I hope it can help you
flutter_dynamic_icon: ^2.0.0

Mohamed Khaled Selim
- 316
- 3
- 5