showPIDialog<T> function

Future<T?> showPIDialog<T>({
  1. required BuildContext context,
  2. bool barrierDismissible = false,
  3. Key? key,
  4. Widget? titleWidget,
  5. String? title,
  6. Widget? contentWidget,
  7. String? content,
  8. TextAlign contentAlign = TextAlign.center,
  9. Widget? extra,
  10. String? cancelText,
  11. Function? cancelTap,
  12. String? confirmText,
  13. ConfirmColors confirmTextColor = ConfirmColors.warn,
  14. Function? confirmTap,
  15. bool isPopDialogOnClickCancel = true,
  16. bool disableButtons = false,
  17. double? width,
  18. double? maxHeight,
  19. double? minHeight,
  20. bool isShowCancel = true,
})

显示弹窗

Implementation

Future<T?> showPIDialog<T>({
  required BuildContext context,
  bool barrierDismissible = false,
  Key? key,
  Widget? titleWidget,
  String? title,
  Widget? contentWidget,
  String? content,
  TextAlign contentAlign = TextAlign.center,
  Widget? extra,
  String? cancelText,
  Function? cancelTap,
  String? confirmText,
  ConfirmColors confirmTextColor = ConfirmColors.warn,
  Function? confirmTap,
  bool isPopDialogOnClickCancel = true,
  bool disableButtons = false,
  double? width,
  double? maxHeight,
  double? minHeight,
  bool isShowCancel = true,
}) {
  return showDialog<T>(
    context: context,
    barrierDismissible: barrierDismissible,
    builder: (context) {
      return PIDialogLayout(
        key: key,
        title: title,
        titleWidget: titleWidget,
        content: content,
        contentAlign: contentAlign,
        contentWidget: contentWidget,
        extra: extra,
        cancelText: cancelText,
        cancelTap: cancelTap,
        confirmText: confirmText,
        confirmTextColor: confirmTextColor,
        confirmTap: confirmTap,
        isPopDialogOnClickCancel: isPopDialogOnClickCancel,
        disableButtons: disableButtons,
        width: width,
        maxHeight: maxHeight,
        minHeight: minHeight,
        isShowCancel: isShowCancel,
      );
    },
  );
}