Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a button with rounded border [duplicate]

Tags:

flutter

How would you make a FlatButton into a button with a rounded border? I have the rounded border shape using RoundedRectangleBorder but somehow need to color the border.

new FlatButton(   child: new Text("Button text),   onPressed: null,   shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0)) ) 

Example of how button with rounded button would look : image

like image 905
S.D. Avatar asked Apr 29 '18 04:04

S.D.


People also ask

How do you make a button border rounded in HTML?

Rounded corners HTML Buttons You can make rounded corners button by adding border-radius of 5px to 10px on HTML buttons.

How can I make a button have a rounded border in Swift?

Now you can change the button attribute to make it's border rounded by override the ViewController's viewDidLoad() function. Below is the ViewController. swift file's source code.


1 Answers

Use OutlinedButton instead of FlatButton.

OutlinedButton(   onPressed: null,   style: ButtonStyle(     shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.0))),   ),   child: const Text("Button text"), ); 
like image 184
Rémi Rousselet Avatar answered Oct 05 '22 00:10

Rémi Rousselet