saveNewImages function

void saveNewImages(
  1. AndroidIconTemplate template,
  2. Image image,
  3. String iconFilePath,
  4. String? flavor,
)

Saves new launcher icons to the project, keeping the old launcher icons. Note: Do not change interpolation unless you end up with better results https://github.com/fluttercommunity/flutter_launcher_icons/issues/101#issuecomment-495528733

Implementation

void saveNewImages(AndroidIconTemplate template, Image image,
    String iconFilePath, String? flavor) {
  final Image newFile = createResizedImage(template.size, image);
  File(constants.androidResFolder(flavor) +
          template.directoryName +
          '/' +
          iconFilePath)
      .create(recursive: true)
      .then((File file) {
    file.writeAsBytesSync(encodePng(newFile));
  });
}