How to remove disable border side Elevated Button. Previously I used Flat Button. After I use the new SDK Version. There are some function buttons that I cannot use. Raised button and Flat button one of them.
Code:
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.white,
padding: EdgeInsets.fromLTRB(30, 5, 30, 5),
side: BorderSide(width: 0, color: Colors.white),
),
child: Align(
alignment: Alignment.center,
child: Text('Dashboard',
style: TextStyle(
color: Colors.black87,
fontSize: 16,
fontWeight: FontWeight.normal)),
),
),
Back to my question. Is there a way for me to disable the border side Elevated Button?
3
Answers
Try adding
elevation:0
to your buttonTwo things to consider:
TextButton
is alternative toFlatButton
in new docs.0
to make it work asFlatButton
.Explanation:
elevation
which you have misunderstood asborder
.Try setting it to
0
.Updated Code
Before:
After:
Replacement of
Flat Button
isText Button
. For further details refer https://docs.flutter.dev/release/breaking-changes/buttonsIf you don’t want border or elevation, perhaps you should not use
ElevatedButton
, but instead aTextButton
.TextButton
is the newFlatButton
.Check the official documentation on TextButton.
Differences:
Not pressing last button:
Pressing last button: