generate method

Future<void> generate()

Configures and generates localization resources for the current project.

Ensures the required dependencies and Flutter configuration are present, generates localization files, runs Flutter localization generation, and validates the resulting configuration.

Implementation

Future<void> generate() async {
  LoggerService.section('Generate Localization');

  _ensureFlutterProject();

  final config = await ConfigService.load();

  final pubspec = PubspecService();
  await pubspec.ensureLocalization();

  await L10nYamlGenerator.generate(config);
  await ArbGenerator.generate(config);
  await FlutterService(config).genL10n();

  LocalizationValidator.validate(config);
  LoggerService.success('Localization generated successfully.');
}