This commit is contained in:
2026-06-03 14:07:10 +08:00
parent 3bdece45c3
commit 9eb8d1cc37
118 changed files with 5689 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
import 'package:flutter/material.dart';
class AppDialog {
AppDialog._();
static Future<bool?> confirm(
BuildContext context, {
String title = '确认操作',
String message = '是否继续?',
String cancelText = '取消',
String confirmText = '确认',
}) {
return showDialog<bool>(
context: context,
builder: (context) {
return AlertDialog(
title: Text(title),
content: Text(message),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(false),
child: Text(cancelText),
),
FilledButton(
onPressed: () => Navigator.of(context).pop(true),
child: Text(confirmText),
),
],
);
},
);
}
}