Skip to content

按钮

按钮种类

按钮备注
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),
  ),
  // ...
);

Released under the MIT License.