This commit is contained in:
problematicconsumer
2023-07-06 17:18:41 +03:30
commit b617c95f62
352 changed files with 21017 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
Future<bool> showConfirmationDialog(
BuildContext context, {
required String title,
required String message,
IconData? icon,
}) async {
return showDialog<bool>(
context: context,
builder: (context) {
final localizations = MaterialLocalizations.of(context);
return AlertDialog(
icon: const Icon(Icons.delete_forever),
title: Text(title),
content: Text(message),
actions: [
TextButton(
onPressed: () => context.pop(true),
child: Text(localizations.okButtonLabel),
),
TextButton(
onPressed: () => context.pop(false),
child: Text(localizations.cancelButtonLabel),
),
],
);
},
).then((value) => value ?? false);
}