doubleButton method
YYDialog
doubleButton({
- 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 text2,
- dynamic color2,
- dynamic fontSize2,
- dynamic fontWeight2,
- dynamic fontFamily2,
- dynamic onTap2,
Implementation
YYDialog doubleButton({
padding,
gravity,
height,
isClickAutoDismiss = true, //点击按钮后自动关闭
withDivider = false, //中间分割线
text1,
color1,
fontSize1,
fontWeight1,
fontFamily1,
VoidCallback? onTap1,
text2,
color2,
fontSize2,
fontWeight2,
fontFamily2,
onTap2,
}) {
return this.widget(
SizedBox(
height: height ?? 45.0,
child: Row(
mainAxisAlignment: getRowMainAxisAlignment(gravity),
children: <Widget>[
TextButton(
onPressed: () {
if (onTap1 != null) onTap1();
if (isClickAutoDismiss) {
dismiss();
}
},
child: Text(
text1 ?? "",
style: TextStyle(
color: color1 ?? null,
fontSize: fontSize1 ?? null,
fontWeight: fontWeight1,
fontFamily: fontFamily1,
),
),
),
Visibility(
visible: withDivider,
child: VerticalDivider(),
),
TextButton(
onPressed: () {
if (onTap2 != null) onTap2();
if (isClickAutoDismiss) {
dismiss();
}
},
child: Text(
text2 ?? "",
style: TextStyle(
color: color2 ?? Colors.black,
fontSize: fontSize2 ?? 14.0,
fontWeight: fontWeight2,
fontFamily: fontFamily2,
),
),
)
],
),
),
);
}