Questions tagged [flutter-lints]

7 questions
38
votes
1 answer

"AVOID using library private types in public APIs" - lint warning, even in in cookbook examples?

I noticed the style error warning https://dart-lang.github.io/linter/lints/library_private_types_in_public_api.html pop up in some of my code but also in the some of the official Flutter/Dart documentation/cookbook examples; e.g. at…
Andre Clements
  • 634
  • 1
  • 7
  • 15
7
votes
1 answer

flutter discarded_futures when using FutureBuilder

I feel like there is an issue with the linter rule discarded_future Is there a way to use the discarded_future lint rule without having to ignore the rule each time i'm using the FutureBuilder. Is that normal that the rule is triggered when using a…
4
votes
7 answers

Unexpected Flutter linter warning: depend_on_referenced_packages

After I recently upgraded flutter to 3.0.0 and flutter_lints to 2.0.1, I started getting the following warning: Depend on referenced packages. Here, the dependency that is imported is defined in the pubspec.yaml of another module that the current…
Ugurcan Yildirim
  • 5,973
  • 3
  • 42
  • 73
1
vote
1 answer

How to suppress depend_on_referenced_packages just for a specific import, not the whole file?

After upgrading to Flutter 3.0 I started to get a lot of depend_on_referenced_packages lint issues when running flutter analyze. If I remove the reported imports the compilation breaks. Most of the issues are with package:collection/collection.dart…
Csaba Toth
  • 10,021
  • 5
  • 75
  • 121
0
votes
2 answers

Do not use BuildContexts across async gaps lint error on presenter layer

Stateless Widget CustomButton.build( label: 'login', onPressed: () { presenter.login(context,username,password); }, ); Presenter class (where we have all the logic) class Presenter { Future login(BuildContext context,String…
Vignesh KM
  • 1,979
  • 1
  • 18
  • 24
0
votes
0 answers

Do not use BuildContexts across async gaps (State management)

I've just upgraded to the major version of flutter lints and I faced this warning about using BuildContext in async methods. I found some answers for this issue without state management, but I don't understand how to use "mounted" in my provider or…
artemniy
  • 1
  • 1