import 'package:flutter/material.dart'; import 'package:tablet_app/constants.dart'; class RoundedButton extends StatelessWidget { final String text; final Function press; final Color color, textColor; final double fontSize; const RoundedButton({ Key key, this.text, this.press, this.color = kMainRed, this.textColor = Colors.white, this.fontSize }) : super(key: key); @override Widget build(BuildContext context) { Size size = MediaQuery.of(context).size; return FlatButton( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(35.0), //side: BorderSide(color: kSubTitleColor) ), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 25), color: color, onPressed: () => { press() }, child: Text( text, style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400), ), ); } }