Jesway / flutter_translate

Flutter Translate is a fully featured localization / internationalization (i18n) library for Flutter.
MIT License
401 stars 118 forks source link

Add null validations for Test #49

Closed diegoveloper closed 3 years ago

diegoveloper commented 4 years ago

When we didn't setup the method channels and mock method handler in Test the tests failing because there is no validation on _translations.

 var translation = _getTranslation(key, _translations);

in that scenario _translations is null and will crash when try to check the key :

map.containsKey(firstKey)
diegoveloper commented 4 years ago

any news about this ? @bratan

IlyaMax commented 3 years ago

@diegoveloper you can achieve it with Localization.load(<String,dynamic>{});