Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: The side property of OutlineButton seems to have no effect

Produces an OutlineButton with a white border:

OutlineButton(
  shape: RoundedRectangleBorder(
    side: BorderSide(
      color: Colors.purple
    )
  ),
)

Produces a FlatButton with a purple border:

FlatButton(
  shape: RoundedRectangleBorder(
    side: BorderSide(
      color: Colors.purple
    )
  ),
)

Part of the documentation for OutlineButton:

borderSide → BorderSide Defines the color of the border when the button is enabled but not pressed, and the border outline's width and style in general. [...] final

like image 313
footurist Avatar asked Nov 01 '18 19:11

footurist


1 Answers

OutlineButton has a property named borderSide you can use it directly :

        OutlineButton(
          borderSide: BorderSide(
              color: Colors.purple
            ),
        )

https://docs.flutter.io/flutter/material/OutlineButton/borderSide.html

like image 67
diegoveloper Avatar answered Oct 31 '22 10:10

diegoveloper