どうも、ちょげ(@chogetarou)です。
色を16進数で指定する方法を紹介します。
方法

色を16進数で指定するには、Color()を使います。
具体的には、Color()の引数にRGBOを16進数で指定します。
Color(0xffffffff) //引数に16進数のRGBO
使用例

@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: Center(
child: Container(
width: 200,
height: 200,
color: Color(0xff2980b9),
),
),
),
);
}
コメント