Flutter自定义按钮

//自定义按钮组件
class MyButton extends StatelessWidget {
  final text;
  final pressed;
  final double width;
  final double height;
  MyButton({this.text, this.pressed = null,this.width = 80.0,this.height=30.0});
  @override
  Widget build(BuildContext context) {
    return Container(
      width: this.width,
      height: this.height,
      child: RaisedButton(
        child: Text(this.text),
        onPressed: this.pressed,
      ),
    );
  }
}

你可能感兴趣的:(Flutter)