twoButton method
ACDDialog
twoButton({
- dynamic padding,
- dynamic gravity,
- dynamic height,
- dynamic isClickAutoDismiss = true,
- dynamic withDivider = false,
- dynamic text1,
- dynamic color1,
- dynamic fontSize1,
- dynamic fontWeight1,
- dynamic fontFamily1,
- VoidCallback? onTap1,
- dynamic buttonPadding1 = const EdgeInsets.all(0.0),
- dynamic text2,
- dynamic color2,
- dynamic fontSize2,
- dynamic fontWeight2,
- dynamic fontFamily2,
- dynamic onTap2,
- dynamic buttonPadding2 = const EdgeInsets.all(0.0),
Implementation
ACDDialog twoButton({
padding,
gravity,
height,
isClickAutoDismiss = true,
withDivider = false,
text1,
color1,
fontSize1,
fontWeight1,
fontFamily1,
VoidCallback? onTap1,
buttonPadding1 = const EdgeInsets.all(0.0),
text2,
color2,
fontSize2,
fontWeight2,
fontFamily2,
onTap2,
buttonPadding2 = const EdgeInsets.all(0.0),
}) {
return widget(
SizedBox(
height: height ?? 45.0,
child: Row(
mainAxisAlignment: getRowMainAxisAlignment(gravity),
children: <Widget>[
TextButton(
onPressed: () {
if (onTap1 != null) onTap1();
if (isClickAutoDismiss) {
dismiss();
}
},
style: TextButton.styleFrom(
foregroundColor: color1 ?? Colors.black,
padding: buttonPadding1,
textStyle: TextStyle(
fontSize: fontSize1 ?? 18.0,
fontWeight: fontWeight1,
fontFamily: fontFamily1,
)),
child: Text(
text1 ?? "",
),
),
Visibility(
visible: withDivider,
child: const VerticalDivider(),
),
TextButton(
onPressed: () {
if (onTap2 != null) onTap2();
if (isClickAutoDismiss) {
dismiss();
}
},
style: TextButton.styleFrom(
foregroundColor: color2 ?? Colors.black,
padding: buttonPadding2,
textStyle: TextStyle(
fontSize: fontSize2 ?? 14.0,
fontWeight: fontWeight2,
fontFamily: fontFamily2,
),
),
child: Text(
text2 ?? "",
),
)
],
),
),
);
}