I'm currently developing an Android app in Flutter. How can I add a rounded button?
Flutter – Create a rounded button / button with border-radius in Flutter
dartflutter
Related Topic
- Flutter – How to work with progress indicator in flutter
- Flutter – How to add a border to a widget in Flutter
- Flutter – Dart SDK is not configured
- Flutter – How to disable a Button in Flutter
- Android – How to change the app display name build with Flutter
- Firebase – No Firebase App ‘[DEFAULT]’ has been created – call Firebase.initializeApp() in Flutter and Firebase
Best Answer
1. Solution Summary
FlatButton
andRaisedButton
are deprecated.So, you can use
shape
which placed in thestyle
property, forTextButton
andElevatedButton
.There are some changes since Flutter 2.0:
style
: the property type has changed toButtonStyle
shape
: the property type has changed toMaterialStateProperty<T>
2. Rounded Button
Inside the
style
property exists theshape
property:Square Button
For a square button you can use
ElevatedButton
or otherwise add:Complete Example