0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Flutter] Depend on referenced packages.のwarningの治し方の一例

Last updated at Posted at 2023-01-27

flutter-logo-sharing.png

こんにちわ。いせきです。最近、FlutterForwardがありましたね。僕はまだまだの実力なので見てもわからないと思い、寝ていました。。。笑
あとで確認してみようと思います。

さて、今回は、Depend on referenced packagesのWarningの治し方の一例をご紹介します。
⚠︎Warningなので、直しても直さなくても問題はありません。あくまでのいいコードにするための一つの方法だと思っていただけると幸いです。

Depend on referenced packagesの解明

翻訳をしてみましょう
「Depend on referenced packages」
「参照するパッケージに依存する」 for deepl

ここだけじゃわかりませんね。

次にこちらのサイトを見てみましょう

こちらのサイトによると、、、、

「参照するパッケージに明示的に依存することで、それらが常に存在することが保証され、依存関係の制約をそれらに設定して、重大な変更から保護することができます。」

なるほど。。。。僕なりにわかりやすい理由を考えてみましたので共有します。

「たまたま、 別で入れたパッケージでwarningのパッケージを使用しているため、作成したファイルでも使用できちゃっている」ということだと考えています。

どうでしょうか?理解できましたでしょうか?少しでもわかったと思ってもらえたら嬉しいです!

warningを修正する方法

1、warningしているPackageを探す。
2、Packageをpubspec.yamlに入れる。
3、pubgetをすると、消える!!

最後に

最近は、インプットが増えすぎて渋滞している状態です。どんどんアウトプットしていきます!!

参考文献

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?