createAdaptiveMonochromeIcons function
Implementation
Future<void> createAdaptiveMonochromeIcons(
Config config,
String? flavor,
) async {
utils.printStatus('Creating adaptive monochrome icons Android');
// Retrieve the necessary Flutter Launcher Icons configuration from the pubspec.yaml file
final String? monochromeImagePath = config.adaptiveIconMonochrome;
if (monochromeImagePath == null) {
throw const InvalidConfigException(errorMissingImagePath);
}
final Image? monochromeImage = await utils.decodeImageFile(monochromeImagePath);
if (monochromeImage == null) {
return;
}
final concurrentIconUpdates = <Future<void>>[];
// Create adaptive icon monochrome images
for (AndroidIconTemplate androidIcon in adaptiveForegroundIcons) {
concurrentIconUpdates.add(
overwriteExistingIcons(
androidIcon,
monochromeImage,
constants.androidAdaptiveMonochromeFileName,
flavor,
),
);
}
await Future.wait(concurrentIconUpdates);
}