flutter – Create a button with rounded border

flutter – Create a button with rounded border

Use OutlinedButton instead of FlatButton.

OutlinedButton(
  onPressed: null,
  style: ButtonStyle(
    shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.0))),
  ),
  child: const Text(Button text),
);
FlatButton(
          onPressed: null,
          child: Text(Button, style: TextStyle(
              color: Colors.blue
            )
          ),
          textColor: MyColor.white,
          shape: RoundedRectangleBorder(side: BorderSide(
            color: Colors.blue,
            width: 1,
            style: BorderStyle.solid
          ), borderRadius: BorderRadius.circular(50)),
        )

flutter – Create a button with rounded border

Use StadiumBorder shape

OutlineButton(
onPressed: () {},
child: Text(Follow),
borderSide: BorderSide(color: Colors.blue),
shape: StadiumBorder(),
)

Leave a Reply

Your email address will not be published.