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

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

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