FlatButton(
child: Text('ORDER NOW'),
onPressed: () {
Provider.of<Orders>(context, listen: false).addOrder(
cart.items.values.toList(),
cart.totalAmount,
);
cart.clear();
},
textcolor: Theme.of(context).primaryColor,
Asked
Active
Viewed 2.3k times
8

Omatt
- 8,564
- 2
- 42
- 144

farouk sherif
- 93
- 1
- 1
- 4
3 Answers
21
You can check breaking-changes/buttons
To have the same visual look
final ButtonStyle flatButtonStyle = TextButton.styleFrom(
foregroundColor: Colors.black87,
minimumSize: Size(88, 36),
padding: EdgeInsets.symmetric(horizontal: 16.0),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(2.0)),
),
);
TextButton(
style: flatButtonStyle,
onPressed: () { },
child: Text('Looks like a FlatButton'),
)
You can find more about restoring-the-original-button-visuals

Md. Yeasin Sheikh
- 54,221
- 7
- 29
- 56
-
2TextButton.styleFrom's primary prop has been replaced with foregroundColor – Petri Sep 23 '22 at 08:17
2
According to the Flutter 3.3.0 release notes, the deprecated RaisedButton
was removed in GitHub pull request #98547.