overwriteExistingIcons function
Future<void>
overwriteExistingIcons(
- AndroidIconTemplate template,
- Image image,
- String filename,
- String? flavor,
Overrides the existing launcher icons in the project Note: Do not change interpolation unless you end up with better results (see issue for result when using cubic interpolation) https://github.com/fluttercommunity/flutter_launcher_icons/issues/101#issuecomment-495528733
Implementation
Future<void> overwriteExistingIcons(
AndroidIconTemplate template,
Image image,
String filename,
String? flavor,
) async {
final Image newFile = utils.createResizedImage(template.size, image);
final pngFile = await File(
constants.androidResFolder(flavor) +
template.directoryName +
'/' +
filename,
).create(recursive: true);
await pngFile.writeAsBytes(encodePng(newFile));
}