0

I want to change my app's icon from inside app in Android and iOS. How can I achieve this to my app

Ujjawal Maurya
  • 462
  • 5
  • 17

2 Answers2

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 icons in ios project

Add some lines in info.plist (>> Raw info.plist <<)

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
0

you can use this package I hope it can help you

flutter_dynamic_icon: ^2.0.0