Closed noxasch closed 1 year ago
Why do you need to import flutter_gen
(this package)? Usually you'd only need to import the generated asset file.
It's not the Asset import, but when we run either from flutter packages pub run build_runner build
or as executable fluttergen
and using flutter_localizations
at the same time,
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
will throw an error Target of URI doesn't exist: ..
as this package share the same name as they share the same package name.
Think I understand you now.. can you create a small sample repo on GH and link it here?
Referring to official flutter i18n guide: https://docs.flutter.dev/development/accessibility-and-localization/internationalization
Running flutter pub get will generate this file
.dart_tool/flutter_gen//gen_l10n/app_localization.dart
thus to use the localization we will need to do
import'package:flutter_gen/gen_l10n/app_localizations.dart'
hence it have the same name as this package, and the import will fail.