3
1

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.

【ちょっと便利な小技_part 4】Visual Studio Codeでflutter開発(Extract Method編)

Last updated at Posted at 2023-08-23

Extract Methodでメソッド化&切り出し

今回はExtract Methodについて
下記画像のMore Extract...にある『Extract Method』は
Widgetをメソッド化して切り出してくれます。
方法はとても簡単なのでぜひやってみてください。

方法

メソッド化したいWidgetにカーソルを合わせて
『cmd』+『.』(Mac)
を選択します。
すると下記の画像のようになります。
スクリーンショット 2023-08-17 17.06.40.png

次にExtract Methodを選択するとメソッド名の入力欄が出てきます。
そこに任意のメソッド名を入力してEnterを押します。
これで完了
スクリーンショット 2023-08-17 17.07.34.png

結果

このようにメソッドとして切り出してくれます。
スクリーンショット 2023-08-17 17.31.57.png

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?