4

How can I implement sideBorder to elevatedButton through themedata.enter image description here

 elevatedButtonTheme: ElevatedButtonThemeData(
    style: ButtonStyle(side: MaterialStateProperty<BorderSide>//Stuck here),
  ),
Raj A
  • 544
  • 9
  • 21

2 Answers2

13

To use Theme Data border in Elevated Button, you have use styleFrom method

elevatedButtonTheme: ElevatedButtonThemeData(
          style: ElevatedButton.styleFrom(
          side: BorderSide(color: Colors.black, width: 2.5)) )

for more info styleFrom

Anas
  • 1,013
  • 1
  • 6
  • 20
3
elevatedButtonTheme: ElevatedButtonThemeData(
  style: ElevatedButton.styleFrom(
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(20),
    ),
  ),
),
keikai
  • 14,085
  • 9
  • 49
  • 68
teddy 225
  • 81
  • 1
  • Could you add some commentary to this answer? What are you providing here that existing answers do not provide? – Captain Hat Dec 02 '22 at 15:25