You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to run widget tests for a widget that uses the plural extension method.
The tests are failing with the following error
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following LateError was thrown building _OpenWorkCount(dirty):
LateInitializationError: Field '_locale@2908425997' has not been initialized.
...
When the exception was thrown, this was the stack:
#0 Localization._locale (package:easy_localization/src/localization.dart)
#1 Localization.plural (package:easy_localization/src/localization.dart:152:36)
#2 plural (package:easy_localization/src/public.dart:114:31)
#3 StringTranslateExtension.plural (package:easy_localization/src/public_ext.dart:104:10)
...
When I change the widget to use just a standard translation with the .tr extension method the tests pass.
Any help on how to set up my tests so that the locale gets initialised would be great.
I am unable to run widget tests for a widget that uses the
plural
extension method.The tests are failing with the following error
When I change the widget to use just a standard translation with the
.tr
extension method the tests pass.Any help on how to set up my tests so that the locale gets initialised would be great.
Right now I am doing the following in my tests.
The text was updated successfully, but these errors were encountered: