createIcons method
Create all icons for the current platform based on
the contents of config
and the flavor
.
Implementation
@override
void createIcons(Map<String, dynamic> config, String? flavor) {
printStatus('Creating default icons Android');
final String filePath = getAndroidIconPath(config);
final Image? image = decodeImage(File(filePath).readAsBytesSync());
if (image == null)
return;
final File androidManifestFile = File(constants.androidManifestFile);
if (isCustomAndroidFile(config)) {
printStatus('Adding a new Android launcher icon');
final String iconName = getNewIconName(config);
isAndroidIconNameCorrectFormat(iconName);
final String iconPath = '$iconName.png';
for (AndroidIconTemplate template in androidIcons) {
saveNewImages(template, image, iconPath, flavor);
}
overwriteAndroidManifestWithNewLauncherIcon(
iconName, androidManifestFile);
} else {
printStatus(
'Overwriting the default Android launcher icon with a new icon');
for (AndroidIconTemplate template in androidIcons) {
overwriteExistingIcons(
template, image, constants.androidFileName, flavor);
}
overwriteAndroidManifestWithNewLauncherIcon(
constants.androidDefaultIconName, androidManifestFile);
}
}