mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-14 05:52:51 +00:00
Added option to block and unblock clients from home screen
This commit is contained in:
parent
71b870b42f
commit
569ab7d569
16 changed files with 139 additions and 53 deletions
|
@ -11,7 +11,7 @@ import 'package:adguard_home_manager/models/menu_option.dart';
|
|||
|
||||
class OptionsMenu extends StatelessWidget {
|
||||
final Widget child;
|
||||
final List<MenuOption> options;
|
||||
final List<MenuOption> Function(dynamic) options;
|
||||
final dynamic value;
|
||||
final BorderRadius? borderRadius;
|
||||
final void Function(dynamic)? onTap;
|
||||
|
@ -40,11 +40,11 @@ class OptionsMenu extends StatelessWidget {
|
|||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: ContextMenuArea(
|
||||
builder: (context) => options.map((opt) => CustomListTile(
|
||||
builder: (context) => options(value).map((opt) => CustomListTile(
|
||||
title: opt.title,
|
||||
icon: opt.icon,
|
||||
onTap: () {
|
||||
opt.action(value);
|
||||
opt.action();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)).toList(),
|
||||
|
@ -64,7 +64,7 @@ class OptionsMenu extends StatelessWidget {
|
|||
}
|
||||
|
||||
class _OptionsModal extends StatelessWidget {
|
||||
final List<MenuOption> options;
|
||||
final List<MenuOption> Function(dynamic) options;
|
||||
final dynamic value;
|
||||
|
||||
const _OptionsModal({
|
||||
|
@ -98,12 +98,12 @@ class _OptionsModal extends StatelessWidget {
|
|||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Wrap(
|
||||
children: options.map((opt) => CustomListTileDialog(
|
||||
children: options(value).map((opt) => CustomListTileDialog(
|
||||
title: opt.title,
|
||||
icon: opt.icon,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
opt.action(value);
|
||||
opt.action();
|
||||
},
|
||||
)).toList()
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue