按钮
按钮种类
| 按钮 | 备注 |
|---|---|
| TextButton | 纯文本按钮 |
| FilledButton | 有填充色的按钮 |
| ElevatedButton | 有填充且有立体效果的按钮 |
| IconButton | 图标按钮* |
*图标按钮的child仍然为Widget
修改按钮样式
修改圆角
dart
return FilledButton(
style: FilledButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10)
)
),
// 注意添加一些padding
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
),
// ...
);