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

Null check operator used on a null value on plurals #297

Closed
RootSoft opened this issue Dec 15, 2020 · 2 comments
Closed

Null check operator used on a null value on plurals #297

RootSoft opened this issue Dec 15, 2020 · 2 comments

Comments

@RootSoft
Copy link

RootSoft commented Dec 15, 2020

When using Sound Null Safety and not specifying all plural keys (zero, one, two, few, may, other), app crashes with the following exception:

Null check operator used on a null value

When the exception was thrown, this was the stack:
#0 Localization._resolvePlural (package:easy_localization/src/localization.dart:133:22)
#1 Localization.plural (package:easy_localization/src/localization.dart:108:14)
#2 plural (package:easy_localization/src/public.dart:82:35)
#3 TextTranslateExtension.plural (package:easy_localization/src/public_ext.dart:41:12)

  "comment": {
    "zero": "no comments",
    "one": "{} comment",
    "few": "{} comments",
    "many": "{} comments",
    "other": "{} comments"
  }

Two is left out

Text(
          'comment',
          style: regularLightTextStyle.copyWith(fontSize: textSizeMicro),
        ).plural(1, context: context)
@Chris1234567899
Copy link

Can confirm this.

@bw-flagship
Copy link
Collaborator

Closing this for now, since it's a very old issue and there were many updates until now -> I suppose it is fixed. If not, please comment here.

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

3 participants