createAdaptiveIconMipmapXmlFile function

void createAdaptiveIconMipmapXmlFile(
  1. Map<String, dynamic> flutterLauncherIconsConfig,
  2. String? flavor
)

Creates the xml file required for the adaptive launcher icon FILE LOCATED HERE: res/mipmap-anydpi/{icon-name-from-yaml-config}.xml

Implementation

void createAdaptiveIconMipmapXmlFile(
    Map<String, dynamic> flutterLauncherIconsConfig, String? flavor) {
  if (isCustomAndroidFile(flutterLauncherIconsConfig)) {
    File(constants.androidAdaptiveXmlFolder(flavor) +
            getNewIconName(flutterLauncherIconsConfig) +
            '.xml')
        .create(recursive: true)
        .then((File adaptiveIcon) {
      adaptiveIcon.writeAsString(xml_template.icLauncherXml);
    });
  } else {
    File(constants.androidAdaptiveXmlFolder(flavor) +
            constants.androidDefaultIconName +
            '.xml')
        .create(recursive: true)
        .then((File adaptiveIcon) {
      adaptiveIcon.writeAsString(xml_template.icLauncherXml);
    });
  }
}