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】DropdownButtonFormFieldの枠線の色を変える

Last updated at Posted at 2023-10-20

どういうことか

こういうWidgetの枠線の色を変える。

スクリーンショット 2023-10-20 11.22.23.png

枠線をつける方法は出てくるが、色を変更する方法は軽く探した感じ見当たらなかった。

やる

実は TextFormField の枠線の色を変更する方法と同じ。

child: DropdownButtonFormField(
  decoration: InputDecoration(
    enabledBorder: OutlineInputBorder( // 非選択状態の枠線の色
      borderSide: BorderSide(color: Colors.grey)
    ),
    focusedBorder: OutlineInputBorder( // 選択状態の枠線の色
      borderSide: BorderSide(color: Colors.blue)
    ),
    fillColor: Colors.white, // 背景色
    filled: true, // これ付けないと背景色が適用されない
    contentPadding: EdgeInsets.all(8),
  ),
// 中略
)

おわり(´・ω・`)

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?