immich/mobile/lib/modules/home/ui/delete_dialog.dart

48 lines
1.3 KiB
Dart
Raw Normal View History

import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
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);
@override
Widget build(BuildContext context, WidgetRef ref) {
return AlertDialog(
2022-10-14 09:15:19 -07:00
// backgroundColor: Colors.grey[200],
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
title: const Text("delete_dialog_title").tr(),
content: const Text("delete_dialog_alert").tr(),
actions: [
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
2022-10-14 09:15:19 -07:00
child: Text(
"delete_dialog_cancel",
2022-10-14 09:15:19 -07:00
style: TextStyle(
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.bold,
),
).tr(),
),
TextButton(
onPressed: () {
2022-10-06 13:41:56 -07:00
onDelete();
Navigator.of(context).pop();
},
child: Text(
"delete_dialog_ok",
2022-10-14 09:15:19 -07:00
style: TextStyle(
color: Colors.red[400],
fontWeight: FontWeight.bold,
),
).tr(),
),
],
);
}
}