defaultButton function
Widget
defaultButton(
{ - dynamic color,
- bool border = true,
- required Color textColor,
- double width = double.infinity,
- double height = 50.0,
- double textSize = 18.0,
- required dynamic text,
- required Function function,
})
Implementation
Widget defaultButton(
{var color,
bool border = true,
required Color textColor,
double width = double.infinity,
double height = 50.0,
double textSize = 18.0,
required text,
required Function function}) =>
Container(
width: width,
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(8.0),
border: border
? Border.all(color: textColor == Colors.white ? color : textColor)
: null),
height: height,
child: MaterialButton(
child: FittedBox(
child: Text(
text,
style: TextStyle(color: textColor, fontSize: textSize),
),
),
onPressed: () {
function();
},
),
);