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