ensureLocalization method

Future<void> ensureLocalization()

Ensures that the project is configured for Flutter localization.

Adds the required localization dependencies, enables Flutter code generation, and saves the updated pubspec.yaml file.

Implementation

Future<void> ensureLocalization() async {
  await _ensureLoaded();
  await ensureFlutterSdkDependency('flutter_localizations');
  await ensureDependency('intl');
  await ensureFlutterGenerate();
  await save();
}