Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 module already depends on. In other words, the dependency flow is as follows:

A (module that gives warning and imports D) -> B -> D

I don't understand why I see this warning. Just because module A doesn't directly depend on library D? What should I do with this warning? How can I eliminate it without ignoring the rule in analysis_options.yaml file?

like image 448
Ugurcan Yildirim Avatar asked Oct 16 '25 16:10

Ugurcan Yildirim


1 Answers

Had the same warning.

In my case it was caused by flutter_localizations.

I realized I put

flutter_localizations:
    sdk: flutter

below dev_dependencies and not below dependencies in pubspec.yaml.

Maybe you have the same or similar problem.

like image 189
MLZ Avatar answered Oct 18 '25 09:10

MLZ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!