3

The current flutter version of my project is 2.2.3 and the version of my intl library is 0.17.0. When I add a new value to any of my language files, I get null safety syntax insertions in my messages_all and l10n files in my generated file. Code snippets :

MessageLookupByLibrary? _findExact(String localeName) {
  switch (localeName) {
    case 'ar':
      return messages_ar.messages;
    case 'de':
      return messages_de.messages;
    case 'en':
      return messages_en.messages;
    case 'fr':
      return messages_fr.messages;
    case 'ru':
      return messages_ru.messages;
    case 'tr':
      return messages_tr.messages;
    default:
      return null;
  }
}

MessageLookByLibrary?

When i edit my language files :

flutter pub global run intl_utils:generate
INFO: No @@locale or _locale field found in intl_ar, assuming 'ar' based on the file name.
INFO: No @@locale or _locale field found in intl_de, assuming 'de' based on the file name.
INFO: No @@locale or _locale field found in intl_en, assuming 'en' based on the file name.
INFO: No @@locale or _locale field found in intl_fr, assuming 'fr' based on the file name.
INFO: No @@locale or _locale field found in intl_ru, assuming 'ru' based on the file name.
INFO: No @@locale or _locale field found in intl_tr, assuming 'tr' based on the file name.
Process finished with exit code 0

Errors like this,

enter image description here

If I haven't made any changes, I don't get an error, but when I make the slightest change, the same errors repeat.

enter image description here

2 Answers2

7

I had the same problem with the newest version (2.5.1) of intl_utils installed. What fixed it for me was deactivating and reactivating intl_utils.

First

flutter pub global deactivate intl_utils

And then reinstall the latest version

flutter pub global activate intl_utils 2.5.1
3

check if you have the latest intl_utils installed.

flutter pub global list

If you haven't installed the latest version run this command. You can check the latest version here

flutter pub global activate intl_utils 2.4.1

Be sure that the package name is intl_utils

This helped me at least.

Cheers

David L
  • 1,134
  • 7
  • 35
DevHachi
  • 41
  • 2