どうも、ちょげ(@chogetarou)です。
LinearProgressIndicatorの色を設定する方法を紹介します。
方法

LinearProgressIndicatorの色を設定するには、引数「valueColor」を使います。
具体的には、LinearProgressIndicatorの引数「valueColor」に「AlwaysStoppedAnimation<Color>(色)」を指定します。
色の指定は、「AlwaysStoppedAnimation<Color>()」の引数にColorsを使ってします。
LinearProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(/*色*/),
),
引数「valueColor」を使えば、LinearProgressIndicatorの色を設定することが出来ます。
使用例
以下は、使用例です。

@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: LinearProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.pink),
),
),
);
}
コメント