forked from gokadzev/Musify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfirmation_dialog.dart
executable file
·49 lines (46 loc) · 1.66 KB
/
confirmation_dialog.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Copyright (C) 2025 Valeri Gokadze
*
* Musify is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Musify is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*
* For more information about Musify, including how to contribute,
* please visit: https://github.com/gokadzev/Musify
*/
import 'package:flutter/material.dart';
import 'package:musify/extensions/l10n.dart';
class ConfirmationDialog extends StatelessWidget {
const ConfirmationDialog({
super.key,
this.confirmationMessage,
required this.submitMessage,
required this.onCancel,
required this.onSubmit,
});
final String? confirmationMessage;
final String submitMessage;
final VoidCallback? onCancel;
final VoidCallback? onSubmit;
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text(context.l10n!.confirmation),
content: confirmationMessage != null ? Text(confirmationMessage!) : null,
actions: <Widget>[
TextButton(onPressed: onCancel, child: Text(context.l10n!.cancel)),
TextButton(onPressed: onSubmit, child: Text(context.l10n!.remove)),
],
);
}
}