Error setting-up flutter_localizations package "Target of URI doesn't exist: 'package:flutter_gen/gen_l10n/app_localizations.dart'."
07:24 01 Jun 2021

This error appears when I try to add language support to my flutter application:

Target of URI doesn't exist: 'package:flutter_gen/gen_l10n/app_localizations.dart'. Try creating the file referenced by the URI, or Try using a URI for a file that does exist.

I’m using flutter_localizations, the project is built with dart 2.7.0

It seems that flutter_localizations needs latest sdk which is dart 2.13.0

How can I fix this?

flutter dart flutter-dependencies