你怎么会FlatButton成为一个圆形边框的按钮?我使用圆形边框形状,RoundedRectangleBorder但不知何故需要为边框着色.
new FlatButton(
child: new Text("Button text),
onPressed: null,
shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0))
)
Run Code Online (Sandbox Code Playgroud)
wiz*_*mea 73
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)),
)
Run Code Online (Sandbox Code Playgroud)
Rém*_*let 56
用OutlineButton而不是FlatButton.
new OutlineButton(
child: new Text("Button text"),
onPressed: null,
shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0))
)
Run Code Online (Sandbox Code Playgroud)
小智 14
new OutlineButton(
child: new Text("blue outline") ,
borderSide: BorderSide(color: Colors.blue),
),
// this property adds outline border color
Run Code Online (Sandbox Code Playgroud)
小智 14
使用StadiumBorder形状
OutlineButton(
onPressed: () {},
child: Text("Follow"),
borderSide: BorderSide(color: Colors.blue),
shape: StadiumBorder(),
)
Run Code Online (Sandbox Code Playgroud)
小智 5
所以我确实使用了完整的样式和边框颜色,如下所示:
new OutlineButton(
shape: StadiumBorder(),
textColor: Colors.blue,
child: Text('Button Text'),
borderSide: BorderSide(
color: Colors.blue, style: BorderStyle.solid,
width: 1),
onPressed: () {},
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
31514 次 |
| 最近记录: |