自定义dialog插件
用来弹出确认取消提示框,或者自定义模态框
-
自定义类:
import 'package:flutter/material.dart'; class dialogUtil { /** * 通用显示确定按钮框 */ static showConfirmDialog(context, options) { showDialog( context: context, // 点击背景区域是否可以关闭 barrierDismissible: options["barrierDismissible"] ?? true, builder: (BuildContext context) { return _ConfirmDialog( title: options["title"], okCallback: options["confirm"], cancelCallBack: options["cancel"]); }); } static showCustomerChargeCoinQrcodeDialog( BuildContext context, String qrcodeData, options) { showDialog( context: context, // 点击背景区域是否可以关闭 barrierDismissible: options["barrierDismissible"] ?? true, builder: (BuildContext context) { return _ConfirmDialog(