1

After setting up all the .json files, pubspec file and initialization in the main method when I am trying to create the codegen_loader.g.dart file from the terminal by invoking flutter pub run easy_localization:generate, it's not getting through. Even no error message is getting.

Below is a snippet of the command line:

PS C:\Users\Prosanto\Desktop\Android Dev\localization> flutter pub run easy_localization:generate -h

PS C:\Users\Prosanto\Desktop\Android Dev\localization> flutter pub run easy_localization:generate -S "assets/translations" -O "lib/translations"

PS C:\Users\Prosanto\Desktop\Android Dev\localization>

Nothing is happening, any help or suggestion is highly helpful.

lepsch
  • 8,927
  • 5
  • 24
  • 44

1 Answers1

5

I dealt with this same issue on Mac, but these steps should still help.

First, I ran this command from the Mac terminal, not from Android Studio (whether that made any difference, who knows, but it wasn't working when running from the IDE). It's different from the easy_localization docs

flutter pub run easy_localization:generate --source-dir assets/translations

After that, I ran this command:

flutter pub run easy_localization:generate -S assets/translations -f keys -o locale_keys.g.dart

And the necessary files were generated as expected. I hope this helps!

Pheepster
  • 6,045
  • 6
  • 41
  • 75