confirm static method

Future<bool?> confirm(
  1. BuildContext context,
  2. String message, {
  3. String title = '确认操作',
  4. String confirmLabel = '确定',
  5. String cancelLabel = '取消',
})
  1. 确认对话框

Implementation

static Future<bool?> confirm(
  BuildContext context,
  String message, {
  String title = '确认操作',
  String confirmLabel = '确定',
  String cancelLabel = '取消',
}) {
  return show<bool>(
    context,
    type: NZDialogType.confirm,
    title: title,
    message: message,
    actions: [
      NZDialogAction(
        label: cancelLabel,
        onPressed: () => Navigator.pop(context, false),
      ),
      NZDialogAction(
        label: confirmLabel,
        isPrimary: true,
        onPressed: () => Navigator.pop(context, true),
      ),
    ],
  );
}