FlutterGen / flutter_gen

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.
https://pub.dev/packages/flutter_gen
MIT License
1.44k stars 142 forks source link

Conflict with flutter internationalization output #267

Closed noxasch closed 1 year ago

noxasch commented 2 years ago

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.

ened commented 1 year ago

Why do you need to import flutter_gen (this package)? Usually you'd only need to import the generated asset file.

noxasch commented 1 year ago

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.

ened commented 1 year ago

Think I understand you now.. can you create a small sample repo on GH and link it here?