Flutter TextFieldウェジェットの背景色を設定するサンプル
環境
Windows11 pro 64bit
Flutter 3.3.7
構文
decoration: InputDecoration(
fillColor: 背景色の設定,
filled: 背景色を使うかどうかの設定,
TextFieldに背景色を設定するには、「fillColor引数」と「filled引数」を使います。
使用例
TextField(
decoration: InputDecoration(
fillColor: Colors.blue,
filled: true,
border: OutlineInputBorder(),
),
)