localizely / flutter-intl-vscode

This VS Code extension generates boilerplate code for localization of Flutter apps with official Dart Intl library
MIT License
87 stars 1 forks source link

Error on generated files #87

Closed kishormainali closed 2 years ago

kishormainali commented 2 years ago

Screen Shot 2022-01-14 at 12 53 49 PM Screen Shot 2022-01-14 at 12 53 34 PM

lzoran commented 2 years ago

Hi @kishor98100,

According to the attached screenshots, I assume that you need to use the null-safe code.

The Flutter Intl extension checks the version of the environment sdk within the pubspec.yaml file and generates the appropriate code according to it.

The example of the pubspec.yaml file that will cause generation of the null-safe code:

...
environment:
  sdk: ">=2.12.0 <3.0.0"
...
kishormainali commented 2 years ago

Hi @lzoran i am using flutter version 2.8 but still error exists

Screen Shot 2022-01-17 at 10 17 40 AM
lzoran commented 2 years ago

Hi @kishor98100,

I've tried to reproduce this issue, but without success. On my machine everything works fine. 😕

Could you check the version of the globally activated intl_utils package (flutter pub global list)? This is the package that the Flutter Intl extension uses for the generation of localization code (the intl_utils ^2.0.0 generates null-safe code).

Also, could you check the Output window within your VS Code? Maybe there are some useful logs.

vs-code-output-window

kishormainali commented 2 years ago

@lzoran i cleaned my pub cache then re run flutter pub run intl_utils:generate and it works fine. thanks for the help.