Flutter easy_localization Localization key not found

Viewed 1417

I have tried implementing easy_localization in my app. For that I have added this folder structure:

enter image description here

For testing I am only using German. My JSON-File looks like this:

{
    "myGenerealConditionHeader": "Mein Allgemeinzustand"
}

My main:

void main() async {

  WidgetsFlutterBinding.ensureInitialized();

  await EasyLocalization.ensureInitialized();

  runApp(
    EasyLocalization(
      supportedLocales: [Locale('de', 'DE')],
      path: 'assets/translations',
      fallbackLocale: Locale('de', 'DE'),
      child: App(userId: userId),
    ),
  );
}

And I am using it like this:

Text(
  'myGenerealConditionHeader'.tr(),
),

But Flutter is complaining with this error:

[ Easy Localization] [WARNING] Localization key [myGenerealConditionHeader] not found

What am I missing here?

0 Answers
Related