Flutter TextFieldウェジェットの背景色を設定するサンプル

環境
Windows11 pro 64bit
Flutter 3.3.7

構文

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
decoration: InputDecoration(
fillColor: 背景色の設定,
filled: 背景色を使うかどうかの設定,
decoration: InputDecoration( fillColor: 背景色の設定, filled: 背景色を使うかどうかの設定,
decoration: InputDecoration(
     fillColor: 背景色の設定,
     filled:  背景色を使うかどうかの設定,

TextFieldに背景色を設定するには、「fillColor引数」と「filled引数」を使います。

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
TextField(
decoration: InputDecoration(
fillColor: Colors.blue,
filled: true,
border: OutlineInputBorder(),
),
)
TextField( decoration: InputDecoration( fillColor: Colors.blue, filled: true, border: OutlineInputBorder(), ), )
TextField(
      decoration: InputDecoration(
              fillColor: Colors.blue,
              filled: true,
              border: OutlineInputBorder(),
       ),
)

 

Flutter

Posted by arkgame