generateContentsFileAsString function

String generateContentsFileAsString(
  1. String newIconName,
  2. String? darkIconName,
  3. String? tintedIconName
)

Implementation

String generateContentsFileAsString(String newIconName, String? darkIconName, String? tintedIconName) {
  final List<Map<String, dynamic>> imageList;
  if (darkIconName == null && tintedIconName == null) {
    imageList = createLegacyImageList(newIconName);
  } else {
    imageList = createImageList(newIconName, darkIconName, tintedIconName);
  }
  final Map<String, dynamic> contentJson = <String, dynamic>{
    'images': imageList,
    'info': ContentsInfoObject(version: 1, author: 'xcode').toJson(),
  };
  return json.encode(contentJson);
}