Suggest imports from custom directories #49137
Labels
analyzer-completion
Issues with the analysis server's code completion feature
analyzer-quick-fix
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P4
type-enhancement
A request for a change that isn't a bug
Issue Description
I'm using auto-generated .arb and .dart files for localization in Flutter. It is generated under the directory .dart_tool/flutter_gen/
When using Quick Fix to find AppLocalizations.of(context) it doesn't suggest the import that should be like following:
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
This import is needed for basically every file in the UI that displays text, so it would help a lot if it was possible to get suggested imports from custom directories outside lib/ as well.
What is the fix
Please make a way to customize the directory scope of the import suggestions or make it automatically somehow.
Other information
For now, I am handling this by making another file within the project with the following code:
AppLocalizations l10nOf(BuildContext context) => AppLocalizations.of(context);
The text was updated successfully, but these errors were encountered: