modifyContentsFile function

Future<void> modifyContentsFile(
  1. String newIconName,
  2. String? darkIconName,
  3. String? tintedIconName
)

Create the Contents.json file

Implementation

Future<void> modifyContentsFile(
  String newIconName,
  String? darkIconName,
  String? tintedIconName,
) async {
  final String newContentsFilename =
      iosAssetFolder + newIconName + '.appiconset/Contents.json';
  final contentsJsonFile = await File(newContentsFilename).create(recursive: true);
  final String contentsFileContent =
      generateContentsFileAsString(newIconName, darkIconName, tintedIconName);
  await contentsJsonFile.writeAsString(contentsFileContent);
}