create_flutter_provider_app
create_flutter_provider_app copied to clipboard
lang/ asset not found
trafficstars
Hi,
I keep getting this error:

I have tried to add it in the pubspec file under :
flutter:
assets:
- lang/
// And - assets/lang
any idea what I need to add also?
move the lang folder one level up to parent directory and keep your change in assets
assets:
- lang/

I propose a different solution @neilbeukes Don't move the folder, and check how I did it here
But long story short:
pubspec.yaml
assets:
- assets/lang/en.json
- assets/lang/zh.json
and change line 27 on the app_localizations.dart to
await rootBundle.loadString('assets/lang/${locale.languageCode}.json');
@arturjnt thanks a lot for the suggestion.