showVVDialog function

void showVVDialog(
  1. BuildContext context, {
  2. String? content,
  3. String? title,
  4. String? hintText,
  5. Widget? contentWidget,
  6. int? maxLength,
  7. double? width,
  8. bool? enableEmoji,
  9. String? confirmButtonText,
  10. String? cancelButtonText,
  11. required VVDialogType type,
  12. DialogTapCallBack? onConfirmTap,
  13. DialogTapCallBack? onCancelTap,
  14. InputConfirmTapCallBack? onConfirmTapWithInput,
  15. bool? showCancelButton,
})

显示对话框的方法 根据不同的类型展示相应的对话框

Implementation

void showVVDialog(BuildContext context,
    {String? content,
    String? title,
    String? hintText,
    Widget? contentWidget,
    int? maxLength,
    double? width,
    bool? enableEmoji,
    String? confirmButtonText,
    String? cancelButtonText,
    required VVDialogType type,
    DialogTapCallBack? onConfirmTap,
    DialogTapCallBack? onCancelTap,
    InputConfirmTapCallBack? onConfirmTapWithInput,
    bool? showCancelButton}) {
  showDialog(
      context: context,
      builder: (context) => Scaffold(
          backgroundColor: Colors.transparent,
          resizeToAvoidBottomInset: true,
          body: _getDialogWidget(
            type: type,
            title: title ?? "",
            content: content ?? "",
            hintText: hintText ?? "",
            maxLength: maxLength ?? 20,
            confirmButtonText: confirmButtonText ?? "",
            cancelButtonText: cancelButtonText ?? "",
            onConfirmTap: onConfirmTap ?? () {},
            onCancelTap: onCancelTap ?? () {},
            onConfirmTapWithInput: onConfirmTapWithInput ?? (String data) {},
            enableEmoji: enableEmoji ?? false,
            showCancelButton: showCancelButton ?? true,
            contentWidget: contentWidget ?? Container(),
            width: width ?? dialogWidth,
          )));
}