2022-07-07 20:40:54 +02:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2022-02-09 20:41:02 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2022-02-13 23:10:42 +02:00
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
2022-02-09 20:41:02 +02:00
|
|
|
|
2022-02-13 23:10:42 +02:00
|
|
|
class DeleteDialog extends ConsumerWidget {
|
2022-10-06 22:41:56 +02:00
|
|
|
final Function onDelete;
|
|
|
|
|
|
|
|
const DeleteDialog({Key? key, required this.onDelete}) : super(key: key);
|
2022-02-09 20:41:02 +02:00
|
|
|
|
|
|
|
@override
|
2022-02-13 23:10:42 +02:00
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
|
|
2022-02-09 20:41:02 +02:00
|
|
|
return AlertDialog(
|
2022-10-14 18:15:19 +02:00
|
|
|
// backgroundColor: Colors.grey[200],
|
2022-02-09 20:41:02 +02:00
|
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
2022-07-07 20:40:54 +02:00
|
|
|
title: const Text("delete_dialog_title").tr(),
|
|
|
|
content: const Text("delete_dialog_alert").tr(),
|
2022-02-09 20:41:02 +02:00
|
|
|
actions: [
|
|
|
|
TextButton(
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
2022-10-14 18:15:19 +02:00
|
|
|
child: Text(
|
2022-07-07 20:40:54 +02:00
|
|
|
"delete_dialog_cancel",
|
2022-10-14 18:15:19 +02:00
|
|
|
style: TextStyle(
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
2022-07-07 20:40:54 +02:00
|
|
|
).tr(),
|
2022-02-09 20:41:02 +02:00
|
|
|
),
|
|
|
|
TextButton(
|
2022-02-13 23:10:42 +02:00
|
|
|
onPressed: () {
|
2022-10-06 22:41:56 +02:00
|
|
|
onDelete();
|
2022-02-13 23:10:42 +02:00
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
2022-02-09 20:41:02 +02:00
|
|
|
child: Text(
|
2022-07-07 20:40:54 +02:00
|
|
|
"delete_dialog_ok",
|
2022-10-14 18:15:19 +02:00
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.red[400],
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
2022-07-07 20:40:54 +02:00
|
|
|
).tr(),
|
2022-02-09 20:41:02 +02:00
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|