**1. Solution Summary**
`FlatButton` and `RaisedButton` are deprecated.
So, you can use `shape` which placed in the `style` property, for `TextButton` and `ElevatedButton`.
There are some changes since Flutter 2.0:
* `style`: the property type has changed to [`ButtonStyle`][1]
* `shape`: the property type has changed to [`MaterialStateProperty<T>`][2]
**2. Rounded Button**
Inside the `style` property exists the `shape` property:
```dart
style: ButtonStyle(
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
side: BorderSide(color: Colors.red)
)
)
)
```
[![Enter image description here][3]][3]
**Square Button**
For a square button you can use `ElevatedButton` or otherwise add:
```dart
style: ButtonStyle(
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
side: BorderSide(color: Colors.red)
)
)
)
```
[![Enter image description here][4]][4]
**Complete Example**
```dart
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
child: Text(
"Add to cart".toUpperCase(),
style: TextStyle(fontSize: 14)
),
style: ButtonStyle(
padding: MaterialStateProperty.all<EdgeInsets>(EdgeInsets.all(15)),
foregroundColor: MaterialStateProperty.all<Color>(Colors.red),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
side: BorderSide(color: Colors.red)
)
)
),
onPressed: () => null
),
SizedBox(width: 10),
ElevatedButton(
child: Text(
"Buy now".toUpperCase(),
style: TextStyle(fontSize: 14)
),
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
backgroundColor: MaterialStateProperty.all<Color>(Colors.red),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
side: BorderSide(color: Colors.red)
)
)
),
onPressed: () => null
)
]
)
```
[1]:
[To see links please register here]
[2]:
[To see links please register here]
[3]:
[4]: