Flutter OutlinedButtonの枠線の色を変えるサンプル
環境
Windows11 pro 64bit
Flutter 3.3.7
構文
style: OutlinedButton.styleFrom(
side: BorderSide(
color: /*枠線の色*/,
),
),
style: OutlinedButton.styleFrom(
side: BorderSide(
color: /*枠線の色*/,
),
),
style: OutlinedButton.styleFrom( side: BorderSide( color: /*枠線の色*/, ), ),
「style」に「OulinedBorder.styleFrom」を指定します。
指定したBorderSideクラスの引数「color」で、枠線の色を設定します。
使用例
OutlinedButton(
style: OutlinedButton.styleFrom(
side: BorderSide(
color: Colors.green, //枠線の色
),
),
onPressed: () {},
child: Text('表示'),
)
OutlinedButton(
style: OutlinedButton.styleFrom(
side: BorderSide(
color: Colors.green, //枠線の色
),
),
onPressed: () {},
child: Text('表示'),
)
OutlinedButton( style: OutlinedButton.styleFrom( side: BorderSide( color: Colors.green, //枠線の色 ), ), onPressed: () {}, child: Text('表示'), )