Files
controle_acesso_educa/lib/widgets/buttom_custom.dart
2023-08-11 17:12:50 -03:00

60 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
class ButtonCustom extends StatelessWidget{
final VoidCallback onPressed;
final String text;
final double fontSize;
final Color colorButton;
final Color colorText;
final Color colorBorder;
final widthCustom;
final double height;
double borderRadiustopRight;
double borderRadiusbottomLeft;
double borderRadiustopLeft;
double borderRadiusbottomRight;
ButtonCustom({
required this.onPressed,
required this.text,
required this.fontSize,
required this.colorButton,
required this.colorText,
required this.colorBorder,
this.widthCustom = 1.0,
this.height = 42.5,
this.borderRadiustopRight = 5.0,
this.borderRadiusbottomLeft = 5.0,
this.borderRadiustopLeft = 5.0,
this.borderRadiusbottomRight = 5.0,
});
@override
Widget build (BuildContext context) {
double width =MediaQuery.of(context).size.width;
return ElevatedButton(
style: ElevatedButton.styleFrom(
primary: colorButton,
minimumSize: Size(width*widthCustom! , height),
side: BorderSide(width: 2,color : colorBorder,),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topRight: Radius.circular(borderRadiustopRight),
bottomLeft: Radius.circular(borderRadiusbottomLeft),
topLeft: Radius.circular(borderRadiustopLeft),
bottomRight: Radius.circular(borderRadiusbottomRight)
),
),
),
onPressed: onPressed,
child: Text(text,
style: TextStyle(
color: colorText,
fontSize: fontSize,
fontWeight: FontWeight.bold
),
) ,
);
}
}