-2

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

3 Answers3

0

Its imposible to change app icons inside app. To change the application icon you need to configure it inside the android folder (manifest, drawable...) and in the ios folder. So when the application is built, it is stored and the icon is selected. It is not possible to change it without doing a new build.

Maikzen
  • 1,248
  • 1
  • 5
  • 18
0

you can use this package I hope it can help you

flutter_dynamic_icon: ^2.0.0
0

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