saveNewIcons function

void saveNewIcons({
  1. required IosIconTemplate template,
  2. required Image image,
  3. required String catalogName,
  4. required String iconName,
})

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

void saveNewIcons({
  required IosIconTemplate template,
  required Image image,
  required String catalogName,
  required String iconName,
}) {
  final String newIconFolder = iosAssetFolder + catalogName + '.appiconset/';
  final Image newFile = createResizedImage(template, image);
  File(newIconFolder + iconName + template.name + '.png')
      .create(recursive: true)
      .then((File file) {
    file.writeAsBytesSync(encodePng(newFile));
  });
}