32 lines
722 B
Dart
32 lines
722 B
Dart
part of '../main.dart';
|
|
|
|
class ActionDialog {
|
|
ActionDialog._();
|
|
|
|
static Future<bool?> show(
|
|
BuildContext context, {
|
|
required String title,
|
|
required String subtitle,
|
|
}) {
|
|
return showDialog<bool>(
|
|
context: context,
|
|
builder: (context) {
|
|
return AlertDialog(
|
|
title: Text(title),
|
|
content: Text(subtitle),
|
|
actions: [
|
|
ElevatedButton(
|
|
onPressed: () => Navigator.of(context).pop(true),
|
|
child: const Text('Yes'),
|
|
),
|
|
ElevatedButton(
|
|
onPressed: () => Navigator.of(context).pop(false),
|
|
child: const Text('No'),
|
|
),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|