createMacOSIcons function
Start create macos icons
Implementation
void createMacOSIcons({required String imagePath}) {
CliLogger.info('Creating macOS icons...');
final image = Icon.loadFile(imagePath);
if (image == null) {
CliLogger.error('The file $imagePath could not be read.',
level: CliLoggerLevel.two);
exit(1);
}
final macosIcons = <MacOSIconTemplate>[
..._createMacTemplates(size: 16, scales: [1, 2]),
..._createMacTemplates(size: 32, scales: [1, 2]),
..._createMacTemplates(size: 128, scales: [1, 2]),
..._createMacTemplates(size: 256, scales: [1, 2]),
..._createMacTemplates(size: 512, scales: [1, 2]),
];
final filenames = <String>{};
for (final template in macosIcons) {
if (filenames.contains(template.filename) == false) {
filenames.add(template.filename);
_saveImageMacOS(template, image);
}
}
CliLogger.success('Generated app icon images', level: CliLoggerLevel.two);
AppleAppIconType(images: macosIcons, assetPath: MACOS_DEFAULT_APP_ICON_DIR)
.saveContentsJson();
}