Flutter OutlinedButtonの枠線の色を変えるサンプル

環境
Windows11 pro 64bit
Flutter 3.3.7

構文

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
style: OutlinedButton.styleFrom(
side: BorderSide(
color: /*枠線の色*/,
),
),
style: OutlinedButton.styleFrom( side: BorderSide( color: /*枠線の色*/, ), ),
style: OutlinedButton.styleFrom(
  side: BorderSide(
    color: /*枠線の色*/, 
  ),
),

「style」に「OulinedBorder.styleFrom」を指定します。
指定したBorderSideクラスの引数「color」で、枠線の色を設定します。

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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('表示'),
)

 

Flutter

Posted by arkgame