adguard-home-manager/lib/screens/clients/options_modal.dart

84 lines
2.2 KiB
Dart
Raw Normal View History

2022-10-07 18:16:22 +02:00
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class OptionsModal extends StatelessWidget {
final void Function() onEdit;
final void Function() onDelete;
const OptionsModal({
Key? key,
required this.onDelete,
required this.onEdit,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return AlertDialog(
2022-11-04 22:56:00 +01:00
contentPadding: const EdgeInsets.symmetric(
horizontal: 0,
vertical: 16
),
2022-10-07 18:16:22 +02:00
title: Column(
children: [
2022-11-05 02:35:35 +01:00
Icon(
Icons.more_horiz,
color: Theme.of(context).listTileTheme.iconColor
),
2022-11-04 22:56:00 +01:00
const SizedBox(height: 16),
2022-11-05 02:35:35 +01:00
Text(
AppLocalizations.of(context)!.options,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface
),
)
2022-10-07 18:16:22 +02:00
],
),
2022-11-04 22:56:00 +01:00
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 24),
ListTile(
onTap: () {
Navigator.pop(context);
onEdit();
},
title: Text(
AppLocalizations.of(context)!.edit,
style: TextStyle(
2022-11-05 02:35:35 +01:00
color: Theme.of(context).colorScheme.onSurface,
fontWeight: FontWeight.normal
2022-10-07 18:16:22 +02:00
),
),
2022-11-04 22:56:00 +01:00
leading: Icon(
Icons.edit,
2022-11-05 02:35:35 +01:00
color: Theme.of(context).listTileTheme.iconColor,
2022-11-04 22:56:00 +01:00
),
),
ListTile(
onTap: () {
Navigator.pop(context);
onDelete();
},
title: Text(
AppLocalizations.of(context)!.delete,
style: TextStyle(
2022-11-05 02:35:35 +01:00
color: Theme.of(context).colorScheme.onSurface,
fontWeight: FontWeight.normal
2022-10-07 18:16:22 +02:00
),
),
2022-11-04 22:56:00 +01:00
leading: Icon(
Icons.delete,
2022-11-05 02:35:35 +01:00
color: Theme.of(context).listTileTheme.iconColor,
2022-11-04 22:56:00 +01:00
),
),
],
2022-10-07 18:16:22 +02:00
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(AppLocalizations.of(context)!.close)
)
],
);
}
}