loadFlutterRenameConfig function

Map loadFlutterRenameConfig()

Loads the flutter_app_identity configuration from pubspec.yaml.

This function reads the pubspec.yaml file and extracts the flutter_app_identity section.

Returns a Map containing the configuration values. Throws an exception if the file or section is missing.

Implementation

Map loadFlutterRenameConfig() {
  final file = File('pubspec.yaml');
  if (!file.existsSync()) throw Exception('pubspec.yaml not found');
  final yaml = loadYaml(file.readAsStringSync());
  final cfg = yaml['flutter_app_identity'];
  if (cfg == null) throw Exception('flutter_app_identity section missing');
  return Map.from(cfg);
}