Flutter Set Change Add Border Color on Raised Button Example

Raised Button widget in flutter support border and also all the type of border styling properties like border color border width. In today’s tutorial we would learn about Add Border Color on Raised Button widget using RoundedRectangleBorder property of Shape object. Using the RoundedRectangleBorder we can pass multiple sub properties like color which represents border color and width which represents border width and set them. So in this tutorial we would Flutter Set Change Add Border Color on Raised Button Android iOS Example.

Contents in this project Flutter Set Change Add Border Color on Raised Button Android iOS Example:

1. Open your project’s main.dart file and import material.dart package.

2. Create void main runApp() method and here we would import our main MyApp app.

3. Creating our main root parent class named as MyApp extends StatelessWidget.

4. Creating Widget Build area -> Material App -> Scaffold widget -> Center widget.

5. Creating Raised Button widget with Border around it.

  1. onPressed : Used to set onClick event on button.
  2. child : Used to set Child widget like button inside Text.
  3. color : Used to set Button background color.
  4. textColor : Used to set button text color.
  5. RoundedRectangleBorder : Used to set border around button.
  6. color : Used to set Border Color.
  7. width : Used to set button border width.

6. Complete source code for main.dart file:

Screenshot:

Flutter Set Change Add Border Color on Raised Button Example

Leave a Reply

Your email address will not be published. Required fields are marked *