Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error, containsKey on null object #197

Closed
tim-teacher opened this issue May 31, 2020 · 1 comment
Closed

Error, containsKey on null object #197

tim-teacher opened this issue May 31, 2020 · 1 comment

Comments

@tim-teacher
Copy link

tim-teacher commented May 31, 2020

I received this issue:
`════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following NoSuchMethodError was thrown building AboutPage(dirty):
The method 'containsKey' was called on null.
Receiver: null
Tried calling: containsKey("about")

The relevant error-causing widget was:
AboutPage file:///Users/ti/Documents/work/bitsens/daycounter/lib/router/app_router.dart:52:33
When the exception was thrown, this was the stack:
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1 Translations.isNestedKey (package:easy_localization/src/translations.dart:40:22)
#2 Translations.get (package:easy_localization/src/translations.dart:7:8)
#3 Localization._resolve (package:easy_localization/src/localization.dart:92:36)
#4 Localization.tr (package:easy_localization/src/localization.dart:37:13)`

My Json is:
{ "about": "About" }
LocaleKeys and CodegenLoader generated correctly.

Here is my main class: runApp(EasyLocalization( supportedLocales: AppLocalization.supportedLocales, path: AppLocalization.path, assetLoader: CodegenLoader(), fallbackLocale: AppLocalization.supportedLocales[0], child: App()));

Could you please help me with that?

@tim-teacher
Copy link
Author

Resolved. I had Locale('en', 'Us') instead of Locale('en').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant