writeAndRunIcons static method

Future<void> writeAndRunIcons(
  1. RebrandConfig config,
  2. String imagePath
)

Implementation

static Future<void> writeAndRunIcons(
  RebrandConfig config,
  String imagePath,
) async {
  final yamlFile = File('assets/rebrand/rebrand_launcher.yaml');
  yamlFile.writeAsStringSync(buildLauncherIconYaml(config, imagePath));

  print("   🎨 Running flutter_launcher_icons...");
  final result = await Process.run('dart', [
    'run',
    'flutter_launcher_icons',
    '-f',
    'assets/rebrand/rebrand_launcher.yaml',
  ], runInShell: true);

  if (result.exitCode != 0) {
    throw "Failed to generate launcher icons: ${result.stderr}";
  }
}