setupFlavors static method

void setupFlavors(
  1. FlavorConfig config,
  2. AppLogger log
)

Implementation

static void setupFlavors(FlavorConfig config, AppLogger log) {
  final root = ConfigService.root;
  final webDir = Directory(p.join(root, 'web'));

  if (!webDir.existsSync()) return;

  log.info('📦 Setting up Web flavors...');

  // Since web doesn't have build-time targets, we can prepare
  // flavor specific manifest files or inject meta tags if needed.
  // However, the cleanest approach is to use the default index.html
  // and rely on dart-define or flutter_dotenv at runtime.

  // Update manifest.json with the base app name or production name.
  _updateManifest(config, log);

  // Update index.html title
  _updateIndexHtml(config, log);

  log.info('✅ Web flavor setup completed.');
}