twoButton method

ACDDialog twoButton({
  1. dynamic padding,
  2. dynamic gravity,
  3. dynamic height,
  4. dynamic isClickAutoDismiss = true,
  5. dynamic withDivider = false,
  6. dynamic text1,
  7. dynamic color1,
  8. dynamic fontSize1,
  9. dynamic fontWeight1,
  10. dynamic fontFamily1,
  11. VoidCallback? onTap1,
  12. dynamic buttonPadding1 = const EdgeInsets.all(0.0),
  13. dynamic text2,
  14. dynamic color2,
  15. dynamic fontSize2,
  16. dynamic fontWeight2,
  17. dynamic fontFamily2,
  18. dynamic onTap2,
  19. 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 ?? "",
            ),
          )
        ],
      ),
    ),
  );
}