Skip to content

Commit

Permalink
fix: possible NPE when calling Translations.of
Browse files Browse the repository at this point in the history
  • Loading branch information
Tienisto committed Nov 3, 2020
1 parent 0f07a3b commit 51d5ff2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void _generateHeader(StringBuffer buffer, List<I18nData> allLocales) {
// TranslationProviderState
buffer.writeln(
'\nclass $translationProviderStateClass extends State<$translationProviderClass> {');
buffer.writeln('\tString locale;');
buffer.writeln('\tString locale = $localeVar;');
buffer.writeln('\n\tvoid setLocale(String newLocale) {');
buffer.writeln('\t\tsetState(() {');
buffer.writeln('\t\t\tlocale = newLocale;');
Expand Down

0 comments on commit 51d5ff2

Please sign in to comment.