manager-app/lib/Components/rounded_button.dart

42 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:manager_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 = kPrimaryColor,
this.textColor = kWhite,
this.fontSize
}) : super(key: key);
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return TextButton(
style: ButtonStyle(
padding: MaterialStateProperty.resolveWith((states) => EdgeInsets.symmetric(vertical: 25, horizontal: 85)),
backgroundColor: MaterialStateColor.resolveWith((states) => color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
)
)
),
onPressed: () => {
press()
},
child: Text(
text,
style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400),
),
);
}
}