请try 下面的示例:
在ElevatedButton示例中:
ElevatedButton(
onPressed: () {
// Add your button click logic here
},
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
side: BorderSide(
width: 2,
color: Colors.green),
),
backgroundColor:
Colors.red,
),
child: Text('My Button'),
),
在OutlineButton示例中:
OutlinedButton(
onPressed: () {
},
style: OutlinedButton.styleFrom(
backgroundColor: Colors.white,
side: BorderSide(
width: 2,
color: Colors.blue,
),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0), // Adjust the radius as needed
),
),
child: Text('My Button'),
),