mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-06-18 23:20:57 +00:00
Optimized filters screen
This commit is contained in:
parent
2afbaf1f93
commit
eb4462d4d0
23 changed files with 1445 additions and 759 deletions
|
@ -1,17 +1,30 @@
|
||||||
import 'package:flutter_web_browser/flutter_web_browser.dart';
|
import 'dart:io';
|
||||||
|
|
||||||
void openUrl(String url) {
|
import 'package:flutter_web_browser/flutter_web_browser.dart';
|
||||||
FlutterWebBrowser.openWebPage(
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
url: url,
|
|
||||||
customTabsOptions: const CustomTabsOptions(
|
void openUrl(String url) async {
|
||||||
instantAppsEnabled: true,
|
if (Platform.isAndroid || Platform.isIOS) {
|
||||||
showTitle: true,
|
FlutterWebBrowser.openWebPage(
|
||||||
urlBarHidingEnabled: false,
|
url: url,
|
||||||
),
|
customTabsOptions: const CustomTabsOptions(
|
||||||
safariVCOptions: const SafariViewControllerOptions(
|
instantAppsEnabled: true,
|
||||||
barCollapsingEnabled: true,
|
showTitle: true,
|
||||||
dismissButtonStyle: SafariViewControllerDismissButtonStyle.close,
|
urlBarHidingEnabled: false,
|
||||||
modalPresentationCapturesStatusBarAppearance: true,
|
),
|
||||||
)
|
safariVCOptions: const SafariViewControllerOptions(
|
||||||
);
|
barCollapsingEnabled: true,
|
||||||
}
|
dismissButtonStyle: SafariViewControllerDismissButtonStyle.close,
|
||||||
|
modalPresentationCapturesStatusBarAppearance: true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
final uri = Uri.parse(url);
|
||||||
|
if (await canLaunchUrl(uri)) {
|
||||||
|
await launchUrl(uri);
|
||||||
|
} else {
|
||||||
|
throw 'Could not launch $url';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -609,5 +609,7 @@
|
||||||
"safeSearchSettingsNotLoaded": "Error when loading safe search settings.",
|
"safeSearchSettingsNotLoaded": "Error when loading safe search settings.",
|
||||||
"loadingLogsSettings": "Loading logs settings...",
|
"loadingLogsSettings": "Loading logs settings...",
|
||||||
"selectOptionLeftColumn": "Select an option of the left column",
|
"selectOptionLeftColumn": "Select an option of the left column",
|
||||||
"selectClientLeftColumn": "Select a client of the left column"
|
"selectClientLeftColumn": "Select a client of the left column",
|
||||||
|
"disableList": "Disable list",
|
||||||
|
"enableList": "Enable list"
|
||||||
}
|
}
|
|
@ -609,5 +609,7 @@
|
||||||
"safeSearchSettingsNotLoaded": "Error al cargar la configuración de búsqueda segura.",
|
"safeSearchSettingsNotLoaded": "Error al cargar la configuración de búsqueda segura.",
|
||||||
"loadingLogsSettings": "Cargando configuración de registros...",
|
"loadingLogsSettings": "Cargando configuración de registros...",
|
||||||
"selectOptionLeftColumn": "Selecciona una opción de la columna de la izquierda",
|
"selectOptionLeftColumn": "Selecciona una opción de la columna de la izquierda",
|
||||||
"selectClientLeftColumn": "Selecciona un cliente de la columna de la izquierda"
|
"selectClientLeftColumn": "Selecciona un cliente de la columna de la izquierda",
|
||||||
|
"disableList": "Deshabilitar lista",
|
||||||
|
"enableList": "Habilitar lista"
|
||||||
}
|
}
|
|
@ -17,12 +17,14 @@ import 'package:adguard_home_manager/constants/enums.dart';
|
||||||
import 'package:adguard_home_manager/models/filtering.dart';
|
import 'package:adguard_home_manager/models/filtering.dart';
|
||||||
import 'package:adguard_home_manager/providers/servers_provider.dart';
|
import 'package:adguard_home_manager/providers/servers_provider.dart';
|
||||||
|
|
||||||
class FiltersFab extends StatelessWidget {
|
class AddFiltersButton extends StatelessWidget {
|
||||||
final String type;
|
final String type;
|
||||||
|
final Widget Function(void Function()) widget;
|
||||||
|
|
||||||
const FiltersFab({
|
const AddFiltersButton({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.type,
|
required this.type,
|
||||||
|
required this.widget
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -68,14 +70,27 @@ class FiltersFab extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
void openAddCustomRule() {
|
void openAddCustomRule() {
|
||||||
Navigator.of(context).push(
|
if (width > 700 || !(Platform.isAndroid || Platform.isIOS)) {
|
||||||
MaterialPageRoute(
|
showDialog(
|
||||||
fullscreenDialog: true,
|
context: context,
|
||||||
builder: (context) => AddCustomRule(
|
builder: (context) => AddCustomRule(
|
||||||
onConfirm: confirmAddRule
|
onConfirm: confirmAddRule,
|
||||||
|
dialog: true,
|
||||||
),
|
),
|
||||||
)
|
barrierDismissible: false
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(
|
||||||
|
fullscreenDialog: true,
|
||||||
|
builder: (context) => AddCustomRule(
|
||||||
|
onConfirm: confirmAddRule,
|
||||||
|
dialog: false,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void confirmAddList({required String name, required String url, required String type}) async {
|
void confirmAddList({required String name, required String url, required String type}) async {
|
||||||
|
@ -182,11 +197,10 @@ class FiltersFab extends StatelessWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FloatingActionButton(
|
return widget(
|
||||||
onPressed: type == 'blacklist' || type == 'whitelist'
|
type == 'blacklist' || type == 'whitelist'
|
||||||
? () => openAddWhitelistBlacklist()
|
? () => openAddWhitelistBlacklist()
|
||||||
: () => openAddCustomRule(),
|
: () => openAddCustomRule(),
|
||||||
child: const Icon(Icons.add),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,17 +1,17 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:flutter_web_browser/flutter_web_browser.dart';
|
|
||||||
|
|
||||||
|
import 'package:adguard_home_manager/functions/open_url.dart';
|
||||||
import 'package:adguard_home_manager/constants/urls.dart';
|
import 'package:adguard_home_manager/constants/urls.dart';
|
||||||
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
|
||||||
|
|
||||||
class AddCustomRule extends StatefulWidget {
|
class AddCustomRule extends StatefulWidget {
|
||||||
final void Function(String) onConfirm;
|
final void Function(String) onConfirm;
|
||||||
|
final bool dialog;
|
||||||
|
|
||||||
const AddCustomRule({
|
const AddCustomRule({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.onConfirm
|
required this.onConfirm,
|
||||||
|
required this.dialog
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -72,293 +72,338 @@ class _AddCustomRuleState extends State<AddCustomRule> {
|
||||||
|
|
||||||
return rule;
|
return rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
void openDocsPage() {
|
|
||||||
FlutterWebBrowser.openWebPage(
|
|
||||||
url: Urls.customRuleDocs,
|
|
||||||
customTabsOptions: const CustomTabsOptions(
|
|
||||||
instantAppsEnabled: true,
|
|
||||||
showTitle: true,
|
|
||||||
urlBarHidingEnabled: false,
|
|
||||||
),
|
|
||||||
safariVCOptions: const SafariViewControllerOptions(
|
|
||||||
barCollapsingEnabled: true,
|
|
||||||
dismissButtonStyle: SafariViewControllerDismissButtonStyle.close,
|
|
||||||
modalPresentationCapturesStatusBarAppearance: true,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
List<Widget> content() {
|
||||||
title: Text(AppLocalizations.of(context)!.addCustomRule),
|
return [
|
||||||
actions: [
|
const SizedBox(height: 24),
|
||||||
IconButton(
|
Row(
|
||||||
onPressed: checkValidValues() == true
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
? () {
|
children: [
|
||||||
Navigator.pop(context);
|
Container(
|
||||||
widget.onConfirm(buildRule());
|
padding: const EdgeInsets.symmetric(
|
||||||
}
|
horizontal: 10,
|
||||||
: null,
|
vertical: 5
|
||||||
icon: const Icon(Icons.check)
|
),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
const SizedBox(width: 10)
|
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
|
||||||
],
|
borderRadius: BorderRadius.circular(30),
|
||||||
),
|
border: Border.all(
|
||||||
body: ListView(
|
color: Theme.of(context).colorScheme.primary
|
||||||
children: [
|
|
||||||
const SizedBox(height: 24),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 10,
|
|
||||||
vertical: 5
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
|
|
||||||
borderRadius: BorderRadius.circular(30),
|
|
||||||
border: Border.all(
|
|
||||||
color: Theme.of(context).colorScheme.primary
|
|
||||||
)
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
buildRule(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.primary,
|
|
||||||
fontWeight: FontWeight.w500
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
],
|
child: Text(
|
||||||
),
|
buildRule(),
|
||||||
const SizedBox(height: 30),
|
textAlign: TextAlign.center,
|
||||||
Padding(
|
style: TextStyle(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
color: Theme.of(context).colorScheme.primary,
|
||||||
child: TextFormField(
|
fontWeight: FontWeight.w500
|
||||||
controller: domainController,
|
|
||||||
onChanged: (value) => setState(() => {}),
|
|
||||||
decoration: InputDecoration(
|
|
||||||
prefixIcon: const Icon(Icons.link_rounded),
|
|
||||||
border: const OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(10)
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
errorText: domainError,
|
)
|
||||||
labelText: AppLocalizations.of(context)!.domain,
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(height: 30),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
|
child: TextFormField(
|
||||||
|
controller: domainController,
|
||||||
|
onChanged: (value) => setState(() => {}),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
prefixIcon: const Icon(Icons.link_rounded),
|
||||||
|
border: const OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(10)
|
||||||
|
)
|
||||||
),
|
),
|
||||||
|
errorText: domainError,
|
||||||
|
labelText: AppLocalizations.of(context)!.domain,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 30),
|
),
|
||||||
Padding(
|
Container(height: 30),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
Padding(
|
||||||
child: SegmentedButton(
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
segments: [
|
child: SegmentedButton(
|
||||||
ButtonSegment(
|
segments: [
|
||||||
value: BlockingPresets.block,
|
ButtonSegment(
|
||||||
label: Text(AppLocalizations.of(context)!.block)
|
value: BlockingPresets.block,
|
||||||
),
|
label: Text(AppLocalizations.of(context)!.block)
|
||||||
ButtonSegment(
|
),
|
||||||
value: BlockingPresets.unblock,
|
ButtonSegment(
|
||||||
label: Text(AppLocalizations.of(context)!.unblock)
|
value: BlockingPresets.unblock,
|
||||||
),
|
label: Text(AppLocalizations.of(context)!.unblock)
|
||||||
ButtonSegment(
|
),
|
||||||
value: BlockingPresets.custom,
|
ButtonSegment(
|
||||||
label: Text(AppLocalizations.of(context)!.custom)
|
value: BlockingPresets.custom,
|
||||||
),
|
label: Text(AppLocalizations.of(context)!.custom)
|
||||||
],
|
),
|
||||||
selected: <BlockingPresets>{preset},
|
],
|
||||||
onSelectionChanged: (value) => setState(() => preset = value.first),
|
selected: <BlockingPresets>{preset},
|
||||||
),
|
onSelectionChanged: (value) => setState(() => preset = value.first),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
),
|
||||||
Material(
|
Container(height: 20),
|
||||||
color: Colors.transparent,
|
Material(
|
||||||
child: InkWell(
|
color: Colors.transparent,
|
||||||
onTap: () => setState(() => addImportant = !addImportant),
|
child: InkWell(
|
||||||
child: Padding(
|
onTap: () => setState(() => addImportant = !addImportant),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 28),
|
child: Padding(
|
||||||
child: Row(
|
padding: const EdgeInsets.symmetric(horizontal: 28),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
child: Row(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
Padding(
|
children: [
|
||||||
padding: const EdgeInsets.only(left: 10),
|
Padding(
|
||||||
child: Text(
|
padding: const EdgeInsets.only(left: 10),
|
||||||
AppLocalizations.of(context)!.addImportant,
|
child: Text(
|
||||||
style: TextStyle(
|
AppLocalizations.of(context)!.addImportant,
|
||||||
fontSize: 16,
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
fontSize: 16,
|
||||||
),
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Switch(
|
),
|
||||||
value: addImportant,
|
Switch(
|
||||||
onChanged: (value) => setState(() => addImportant = value),
|
value: addImportant,
|
||||||
)
|
onChanged: (value) => setState(() => addImportant = value),
|
||||||
],
|
)
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
),
|
||||||
Padding(
|
Container(height: 20),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
Padding(
|
||||||
child: Card(
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
child: Padding(
|
child: Card(
|
||||||
padding: const EdgeInsets.all(20),
|
child: Padding(
|
||||||
child: Column(
|
padding: const EdgeInsets.all(20),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.info,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
|
),
|
||||||
|
const SizedBox(width: 20),
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context)!.examples,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
SizedBox(
|
||||||
|
width: double.maxFinite,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"||example.org^",
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Theme.of(context).colorScheme.primary
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context)!.example1,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Theme.of(context).colorScheme.primary
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Text(
|
||||||
|
"@@||example.org^",
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Theme.of(context).colorScheme.primary
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context)!.example2,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Theme.of(context).colorScheme.primary
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Text(
|
||||||
|
"! Here goes a comment",
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Theme.of(context).colorScheme.primary
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"# Also a comment",
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Theme.of(context).colorScheme.primary
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context)!.example3,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Theme.of(context).colorScheme.primary
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Text(
|
||||||
|
"/REGEX/",
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Theme.of(context).colorScheme.primary
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context)!.example4,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Theme.of(context).colorScheme.primary
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(height: 20),
|
||||||
|
Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => openUrl(Urls.customRuleDocs),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 10),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 10),
|
||||||
|
child: Text(
|
||||||
|
AppLocalizations.of(context)!.moreInformation,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 15),
|
||||||
|
child: Icon(
|
||||||
|
Icons.open_in_new,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(height: 20)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (widget.dialog == true) {
|
||||||
|
return Dialog(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(
|
||||||
|
maxWidth: 500
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
IconButton(
|
||||||
Icons.info,
|
onPressed: () => Navigator.pop(context),
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
icon: const Icon(Icons.clear_rounded),
|
||||||
|
tooltip: AppLocalizations.of(context)!.close,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 20),
|
const SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context)!.examples,
|
AppLocalizations.of(context)!.addCustomRule,
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 22
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
IconButton(
|
||||||
SizedBox(
|
onPressed: checkValidValues() == true
|
||||||
width: double.maxFinite,
|
? () {
|
||||||
child: Column(
|
Navigator.pop(context);
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
widget.onConfirm(buildRule());
|
||||||
children: [
|
}
|
||||||
Text(
|
: null,
|
||||||
"||example.org^",
|
icon: const Icon(Icons.check)
|
||||||
textAlign: TextAlign.left,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Theme.of(context).colorScheme.primary
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
Text(
|
|
||||||
AppLocalizations.of(context)!.example1,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Theme.of(context).colorScheme.primary
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
Text(
|
|
||||||
"@@||example.org^",
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Theme.of(context).colorScheme.primary
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
Text(
|
|
||||||
AppLocalizations.of(context)!.example2,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Theme.of(context).colorScheme.primary
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
Text(
|
|
||||||
"! Here goes a comment",
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Theme.of(context).colorScheme.primary
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"# Also a comment",
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Theme.of(context).colorScheme.primary
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
Text(
|
|
||||||
AppLocalizations.of(context)!.example3,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Theme.of(context).colorScheme.primary
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
Text(
|
|
||||||
"/REGEX/",
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Theme.of(context).colorScheme.primary
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
Text(
|
|
||||||
AppLocalizations.of(context)!.example4,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Theme.of(context).colorScheme.primary
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Flexible(
|
||||||
),
|
child: SingleChildScrollView(
|
||||||
const SizedBox(height: 20),
|
child: Wrap(
|
||||||
Material(
|
alignment: WrapAlignment.center,
|
||||||
color: Colors.transparent,
|
children: content(),
|
||||||
child: InkWell(
|
),
|
||||||
onTap: openDocsPage,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 10),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 10),
|
|
||||||
child: Text(
|
|
||||||
AppLocalizations.of(context)!.moreInformation,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 15),
|
|
||||||
child: Icon(
|
|
||||||
Icons.open_in_new,
|
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20)
|
),
|
||||||
],
|
);
|
||||||
),
|
}
|
||||||
);
|
else {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(AppLocalizations.of(context)!.addCustomRule),
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: checkValidValues() == true
|
||||||
|
? () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
widget.onConfirm(buildRule());
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
icon: const Icon(Icons.check)
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: ListView(
|
||||||
|
children: content(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -12,7 +12,12 @@ import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
||||||
import 'package:adguard_home_manager/providers/servers_provider.dart';
|
import 'package:adguard_home_manager/providers/servers_provider.dart';
|
||||||
|
|
||||||
class BlockedServicesScreen extends StatelessWidget {
|
class BlockedServicesScreen extends StatelessWidget {
|
||||||
const BlockedServicesScreen({Key? key}) : super(key: key);
|
final bool dialog;
|
||||||
|
|
||||||
|
const BlockedServicesScreen({
|
||||||
|
Key? key,
|
||||||
|
required this.dialog
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -21,7 +26,8 @@ class BlockedServicesScreen extends StatelessWidget {
|
||||||
|
|
||||||
return BlockedServicesScreenWidget(
|
return BlockedServicesScreenWidget(
|
||||||
serversProvider: serversProvider,
|
serversProvider: serversProvider,
|
||||||
appConfigProvider: appConfigProvider
|
appConfigProvider: appConfigProvider,
|
||||||
|
dialog: dialog,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,11 +35,13 @@ class BlockedServicesScreen extends StatelessWidget {
|
||||||
class BlockedServicesScreenWidget extends StatefulWidget {
|
class BlockedServicesScreenWidget extends StatefulWidget {
|
||||||
final ServersProvider serversProvider;
|
final ServersProvider serversProvider;
|
||||||
final AppConfigProvider appConfigProvider;
|
final AppConfigProvider appConfigProvider;
|
||||||
|
final bool dialog;
|
||||||
|
|
||||||
const BlockedServicesScreenWidget({
|
const BlockedServicesScreenWidget({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.serversProvider,
|
required this.serversProvider,
|
||||||
required this.appConfigProvider,
|
required this.appConfigProvider,
|
||||||
|
required this.dialog
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -209,24 +217,74 @@ class _BlockedServicesScreenStateWidget extends State<BlockedServicesScreenWidge
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
if (widget.dialog == true) {
|
||||||
appBar: AppBar(
|
return Dialog(
|
||||||
title: Text(AppLocalizations.of(context)!.blockedServices),
|
child: ConstrainedBox(
|
||||||
actions: [
|
constraints: const BoxConstraints(
|
||||||
IconButton(
|
maxWidth: 400
|
||||||
onPressed: updateBlockedServices,
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.save_rounded
|
|
||||||
),
|
|
||||||
tooltip: AppLocalizations.of(context)!.save,
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10)
|
child: Column(
|
||||||
],
|
children: [
|
||||||
),
|
Padding(
|
||||||
body: RefreshIndicator(
|
padding: const EdgeInsets.all(16),
|
||||||
onRefresh: loadBlockedServices,
|
child: Row(
|
||||||
child: body()
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
),
|
children: [
|
||||||
);
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
icon: const Icon(Icons.clear_rounded),
|
||||||
|
tooltip: AppLocalizations.of(context)!.close,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context)!.blockedServices,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 22
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: updateBlockedServices,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.save_rounded
|
||||||
|
),
|
||||||
|
tooltip: AppLocalizations.of(context)!.save,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: body()
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(AppLocalizations.of(context)!.blockedServices),
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: updateBlockedServices,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.save_rounded
|
||||||
|
),
|
||||||
|
tooltip: AppLocalizations.of(context)!.save,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: RefreshIndicator(
|
||||||
|
onRefresh: loadBlockedServices,
|
||||||
|
child: body()
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,33 +2,27 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/screens/filters/fab.dart';
|
import 'package:adguard_home_manager/screens/filters/add_button.dart';
|
||||||
import 'package:adguard_home_manager/screens/filters/remove_custom_rule_modal.dart';
|
|
||||||
import 'package:adguard_home_manager/widgets/tab_content_list.dart';
|
import 'package:adguard_home_manager/widgets/tab_content_list.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/functions/snackbar.dart';
|
|
||||||
import 'package:adguard_home_manager/constants/enums.dart';
|
import 'package:adguard_home_manager/constants/enums.dart';
|
||||||
import 'package:adguard_home_manager/models/filtering.dart';
|
|
||||||
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
|
||||||
import 'package:adguard_home_manager/services/http_requests.dart';
|
|
||||||
import 'package:adguard_home_manager/providers/servers_provider.dart';
|
|
||||||
import 'package:adguard_home_manager/classes/process_modal.dart';
|
|
||||||
|
|
||||||
class CustomRulesList extends StatefulWidget {
|
class CustomRulesList extends StatefulWidget {
|
||||||
final LoadStatus loadStatus;
|
final LoadStatus loadStatus;
|
||||||
final ScrollController scrollController;
|
final ScrollController scrollController;
|
||||||
final List<String> data;
|
final List<String> data;
|
||||||
final Future<void> Function() fetchData;
|
final Future<void> Function() fetchData;
|
||||||
|
final void Function(String) onRemoveCustomRule;
|
||||||
|
|
||||||
const CustomRulesList({
|
const CustomRulesList({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.loadStatus,
|
required this.loadStatus,
|
||||||
required this.scrollController,
|
required this.scrollController,
|
||||||
required this.data,
|
required this.data,
|
||||||
required this.fetchData
|
required this.fetchData,
|
||||||
|
required this.onRemoveCustomRule
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -61,52 +55,6 @@ class _CustomRulesListState extends State<CustomRulesList> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final serversProvider = Provider.of<ServersProvider>(context);
|
|
||||||
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
|
||||||
|
|
||||||
void removeCustomRule(String rule) async {
|
|
||||||
ProcessModal processModal = ProcessModal(context: context);
|
|
||||||
processModal.open(AppLocalizations.of(context)!.deletingRule);
|
|
||||||
|
|
||||||
final List<String> newRules = serversProvider.filtering.data!.userRules.where((r) => r != rule).toList();
|
|
||||||
|
|
||||||
final result = await setCustomRules(server: serversProvider.selectedServer!, rules: newRules);
|
|
||||||
|
|
||||||
processModal.close();
|
|
||||||
|
|
||||||
if (result['result'] == 'success') {
|
|
||||||
FilteringData filteringData = serversProvider.filtering.data!;
|
|
||||||
filteringData.userRules = newRules;
|
|
||||||
serversProvider.setFilteringData(filteringData);
|
|
||||||
|
|
||||||
showSnacbkar(
|
|
||||||
context: context,
|
|
||||||
appConfigProvider: appConfigProvider,
|
|
||||||
label: AppLocalizations.of(context)!.ruleRemovedSuccessfully,
|
|
||||||
color: Colors.green
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
appConfigProvider.addLog(result['log']);
|
|
||||||
|
|
||||||
showSnacbkar(
|
|
||||||
context: context,
|
|
||||||
appConfigProvider: appConfigProvider,
|
|
||||||
label: AppLocalizations.of(context)!.ruleNotRemoved,
|
|
||||||
color: Colors.red
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void openRemoveCustomRuleModal(String rule) {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => RemoveCustomRule(
|
|
||||||
onConfirm: () => removeCustomRule(rule),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool checkIfComment(String value) {
|
bool checkIfComment(String value) {
|
||||||
final regex = RegExp(r'^(!|#).*$');
|
final regex = RegExp(r'^(!|#).*$');
|
||||||
if (regex.hasMatch(value)) {
|
if (regex.hasMatch(value)) {
|
||||||
|
@ -184,7 +132,7 @@ class _CustomRulesListState extends State<CustomRulesList> {
|
||||||
),
|
),
|
||||||
subtitle: generateSubtitle(widget.data[index]),
|
subtitle: generateSubtitle(widget.data[index]),
|
||||||
trailing: IconButton(
|
trailing: IconButton(
|
||||||
onPressed: () => openRemoveCustomRuleModal(widget.data[index]),
|
onPressed: () => widget.onRemoveCustomRule(widget.data[index]),
|
||||||
icon: const Icon(Icons.delete)
|
icon: const Icon(Icons.delete)
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -239,8 +187,12 @@ class _CustomRulesListState extends State<CustomRulesList> {
|
||||||
),
|
),
|
||||||
loadStatus: widget.loadStatus,
|
loadStatus: widget.loadStatus,
|
||||||
onRefresh: widget.fetchData,
|
onRefresh: widget.fetchData,
|
||||||
fab: const FiltersFab(
|
fab: AddFiltersButton(
|
||||||
type: 'custom_rule',
|
type: 'custom_rule',
|
||||||
|
widget: (fn) => FloatingActionButton(
|
||||||
|
onPressed: fn,
|
||||||
|
child: const Icon(Icons.add),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
fabVisible: isVisible,
|
fabVisible: isVisible,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class FilterListTile extends StatelessWidget {
|
|
||||||
final IconData icon;
|
|
||||||
final String title;
|
|
||||||
final String subtitle;
|
|
||||||
final Color? color;
|
|
||||||
final bool? bold;
|
|
||||||
|
|
||||||
const FilterListTile({
|
|
||||||
Key? key,
|
|
||||||
required this.icon,
|
|
||||||
required this.title,
|
|
||||||
required this.subtitle,
|
|
||||||
this.color,
|
|
||||||
this.bold,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Container(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
icon,
|
|
||||||
size: 24,
|
|
||||||
color: Theme.of(context).listTileTheme.iconColor,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 16),
|
|
||||||
Flexible(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
title,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 3),
|
|
||||||
Text(
|
|
||||||
subtitle,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: color ?? Theme.of(context).listTileTheme.textColor,
|
|
||||||
fontWeight: bold == true ? FontWeight.bold : FontWeight.w400
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,15 +6,18 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/screens/filters/filters_list.dart';
|
|
||||||
import 'package:adguard_home_manager/screens/filters/check_host_modal.dart';
|
import 'package:adguard_home_manager/screens/filters/check_host_modal.dart';
|
||||||
import 'package:adguard_home_manager/screens/filters/custom_rules_list.dart';
|
import 'package:adguard_home_manager/screens/filters/filters_tabs_view.dart';
|
||||||
|
import 'package:adguard_home_manager/screens/filters/filters_triple_column.dart';
|
||||||
|
import 'package:adguard_home_manager/screens/filters/list_details_screen.dart';
|
||||||
|
import 'package:adguard_home_manager/screens/filters/remove_custom_rule_modal.dart';
|
||||||
import 'package:adguard_home_manager/screens/filters/blocked_services_screen.dart';
|
import 'package:adguard_home_manager/screens/filters/blocked_services_screen.dart';
|
||||||
import 'package:adguard_home_manager/screens/filters/update_interval_lists_modal.dart';
|
import 'package:adguard_home_manager/screens/filters/update_interval_lists_modal.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/functions/snackbar.dart';
|
import 'package:adguard_home_manager/functions/snackbar.dart';
|
||||||
import 'package:adguard_home_manager/classes/process_modal.dart';
|
import 'package:adguard_home_manager/classes/process_modal.dart';
|
||||||
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
||||||
|
import 'package:adguard_home_manager/models/filtering.dart';
|
||||||
import 'package:adguard_home_manager/constants/enums.dart';
|
import 'package:adguard_home_manager/constants/enums.dart';
|
||||||
import 'package:adguard_home_manager/services/http_requests.dart';
|
import 'package:adguard_home_manager/services/http_requests.dart';
|
||||||
import 'package:adguard_home_manager/models/clients.dart';
|
import 'package:adguard_home_manager/models/clients.dart';
|
||||||
|
@ -49,10 +52,7 @@ class FiltersWidget extends StatefulWidget {
|
||||||
State<FiltersWidget> createState() => _FiltersWidgetState();
|
State<FiltersWidget> createState() => _FiltersWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _FiltersWidgetState extends State<FiltersWidget> with TickerProviderStateMixin {
|
class _FiltersWidgetState extends State<FiltersWidget> {
|
||||||
late TabController tabController;
|
|
||||||
final ScrollController scrollController = ScrollController();
|
|
||||||
|
|
||||||
Future fetchFilters() async {
|
Future fetchFilters() async {
|
||||||
widget.serversProvider.setFilteringLoadStatus(LoadStatus.loading, false);
|
widget.serversProvider.setFilteringLoadStatus(LoadStatus.loading, false);
|
||||||
|
|
||||||
|
@ -70,20 +70,14 @@ class _FiltersWidgetState extends State<FiltersWidget> with TickerProviderStateM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<AutoClient> generateClientsList(List<AutoClient> clients, List<String> ips) {
|
||||||
|
return clients.where((client) => ips.contains(client.ip)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
fetchFilters();
|
fetchFilters();
|
||||||
super.initState();
|
super.initState();
|
||||||
tabController = TabController(
|
|
||||||
initialIndex: 0,
|
|
||||||
length: 3,
|
|
||||||
vsync: this,
|
|
||||||
);
|
|
||||||
tabController.addListener(() => widget.appConfigProvider.setSelectedFiltersTab(tabController.index));
|
|
||||||
}
|
|
||||||
|
|
||||||
List<AutoClient> generateClientsList(List<AutoClient> clients, List<String> ips) {
|
|
||||||
return clients.where((client) => ips.contains(client.ip)).toList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -232,200 +226,222 @@ class _FiltersWidgetState extends State<FiltersWidget> with TickerProviderStateM
|
||||||
|
|
||||||
void openBlockedServicesModal() {
|
void openBlockedServicesModal() {
|
||||||
Future.delayed(const Duration(seconds: 0), () {
|
Future.delayed(const Duration(seconds: 0), () {
|
||||||
Navigator.of(context).push(
|
if (width > 700 || !(Platform.isAndroid || Platform.isIOS)) {
|
||||||
MaterialPageRoute(
|
showDialog(
|
||||||
builder: (context) => const BlockedServicesScreen(),
|
context: context,
|
||||||
)
|
builder: (context) => const BlockedServicesScreen(
|
||||||
);
|
dialog: true,
|
||||||
|
),
|
||||||
|
barrierDismissible: false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => const BlockedServicesScreen(
|
||||||
|
dialog: false,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return DefaultTabController(
|
void removeCustomRule(String rule) async {
|
||||||
length: 3,
|
ProcessModal processModal = ProcessModal(context: context);
|
||||||
child: NestedScrollView(
|
processModal.open(AppLocalizations.of(context)!.deletingRule);
|
||||||
controller: scrollController,
|
|
||||||
headerSliverBuilder: ((context, innerBoxIsScrolled) {
|
final List<String> newRules = serversProvider.filtering.data!.userRules.where((r) => r != rule).toList();
|
||||||
return [
|
|
||||||
SliverOverlapAbsorber(
|
final result = await setCustomRules(server: serversProvider.selectedServer!, rules: newRules);
|
||||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
|
||||||
sliver: SliverAppBar(
|
processModal.close();
|
||||||
title: Text(AppLocalizations.of(context)!.filters),
|
|
||||||
pinned: true,
|
if (result['result'] == 'success') {
|
||||||
floating: true,
|
FilteringData filteringData = serversProvider.filtering.data!;
|
||||||
forceElevated: innerBoxIsScrolled,
|
filteringData.userRules = newRules;
|
||||||
centerTitle: false,
|
serversProvider.setFilteringData(filteringData);
|
||||||
actions: serversProvider.filtering.loadStatus == LoadStatus.loaded ? [
|
|
||||||
IconButton(
|
showSnacbkar(
|
||||||
onPressed: enableDisableFiltering,
|
context: context,
|
||||||
tooltip: serversProvider.filtering.data!.enabled == true
|
appConfigProvider: appConfigProvider,
|
||||||
? AppLocalizations.of(context)!.disableFiltering
|
label: AppLocalizations.of(context)!.ruleRemovedSuccessfully,
|
||||||
: AppLocalizations.of(context)!.enableFiltering,
|
color: Colors.green
|
||||||
icon: Stack(
|
);
|
||||||
children: [
|
}
|
||||||
const Icon(Icons.power_settings_new_rounded),
|
else {
|
||||||
Positioned(
|
appConfigProvider.addLog(result['log']);
|
||||||
bottom: 0,
|
|
||||||
right: 0,
|
showSnacbkar(
|
||||||
child: Stack(
|
context: context,
|
||||||
children: [
|
appConfigProvider: appConfigProvider,
|
||||||
Container(
|
label: AppLocalizations.of(context)!.ruleNotRemoved,
|
||||||
decoration: BoxDecoration(
|
color: Colors.red
|
||||||
borderRadius: BorderRadius.circular(30),
|
);
|
||||||
color: Colors.white
|
}
|
||||||
),
|
}
|
||||||
child: Icon(
|
|
||||||
serversProvider.filtering.data!.enabled == true
|
void openRemoveCustomRuleModal(String rule) {
|
||||||
? Icons.check_circle_rounded
|
showDialog(
|
||||||
: Icons.cancel,
|
context: context,
|
||||||
size: 12,
|
builder: (context) => RemoveCustomRule(
|
||||||
color: serversProvider.filtering.data!.enabled == true
|
onConfirm: () => removeCustomRule(rule),
|
||||||
? appConfigProvider.useThemeColorForStatus == true
|
)
|
||||||
? Theme.of(context).colorScheme.primary
|
);
|
||||||
: Colors.green
|
}
|
||||||
: appConfigProvider.useThemeColorForStatus == true
|
|
||||||
? Colors.grey
|
void openListDetails(Filter filter, String type) {
|
||||||
: Colors.red
|
if (width > 900 || !(Platform.isAndroid || Platform.isIOS)) {
|
||||||
),
|
showDialog(
|
||||||
),
|
context: context,
|
||||||
],
|
builder: (context) => ListDetailsScreen(
|
||||||
),
|
list: filter,
|
||||||
)
|
type: type,
|
||||||
],
|
dialog: true,
|
||||||
)
|
),
|
||||||
|
barrierDismissible: false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => ListDetailsScreen(
|
||||||
|
list: filter,
|
||||||
|
type: type,
|
||||||
|
dialog: false,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Widget> actions() {
|
||||||
|
if (serversProvider.filtering.loadStatus == LoadStatus.loaded) {
|
||||||
|
return [
|
||||||
|
IconButton(
|
||||||
|
onPressed: enableDisableFiltering,
|
||||||
|
tooltip: serversProvider.filtering.data!.enabled == true
|
||||||
|
? AppLocalizations.of(context)!.disableFiltering
|
||||||
|
: AppLocalizations.of(context)!.enableFiltering,
|
||||||
|
icon: Stack(
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.power_settings_new_rounded),
|
||||||
|
Positioned(
|
||||||
|
bottom: 0,
|
||||||
|
right: 0,
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
color: Colors.white
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
serversProvider.filtering.data!.enabled == true
|
||||||
|
? Icons.check_circle_rounded
|
||||||
|
: Icons.cancel,
|
||||||
|
size: 12,
|
||||||
|
color: serversProvider.filtering.data!.enabled == true
|
||||||
|
? appConfigProvider.useThemeColorForStatus == true
|
||||||
|
? Theme.of(context).colorScheme.primary
|
||||||
|
: Colors.green
|
||||||
|
: appConfigProvider.useThemeColorForStatus == true
|
||||||
|
? Colors.grey
|
||||||
|
: Colors.red
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
IconButton(
|
)
|
||||||
onPressed: () {
|
],
|
||||||
if (width > 900 || !(Platform.isAndroid || Platform.isIOS)) {
|
)
|
||||||
showDialog(
|
),
|
||||||
context: context,
|
IconButton(
|
||||||
builder: (context) => UpdateIntervalListsModal(
|
onPressed: () {
|
||||||
interval: serversProvider.filtering.data!.interval,
|
if (width > 900 || !(Platform.isAndroid || Platform.isIOS)) {
|
||||||
onChange: setUpdateFrequency,
|
showDialog(
|
||||||
dialog: true,
|
context: context,
|
||||||
),
|
builder: (context) => UpdateIntervalListsModal(
|
||||||
);
|
interval: serversProvider.filtering.data!.interval,
|
||||||
}
|
onChange: setUpdateFrequency,
|
||||||
else {
|
dialog: true,
|
||||||
showModalBottomSheet(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => UpdateIntervalListsModal(
|
|
||||||
interval: serversProvider.filtering.data!.interval,
|
|
||||||
onChange: setUpdateFrequency,
|
|
||||||
dialog: false,
|
|
||||||
),
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
isScrollControlled: true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.update_rounded)
|
|
||||||
),
|
),
|
||||||
PopupMenuButton(
|
);
|
||||||
itemBuilder: (context) => [
|
}
|
||||||
PopupMenuItem(
|
else {
|
||||||
onTap: fetchUpdateLists,
|
showModalBottomSheet(
|
||||||
child: Row(
|
context: context,
|
||||||
children: [
|
builder: (context) => UpdateIntervalListsModal(
|
||||||
const Icon(Icons.sync_rounded),
|
interval: serversProvider.filtering.data!.interval,
|
||||||
const SizedBox(width: 10),
|
onChange: setUpdateFrequency,
|
||||||
Text(AppLocalizations.of(context)!.updateLists)
|
dialog: false,
|
||||||
],
|
|
||||||
)
|
|
||||||
),
|
|
||||||
PopupMenuItem(
|
|
||||||
onTap: openBlockedServicesModal,
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
const Icon(Icons.block),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
Text(AppLocalizations.of(context)!.blockedServices)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
),
|
|
||||||
PopupMenuItem(
|
|
||||||
onTap: showCheckHostModal,
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
const Icon(Icons.shield_rounded),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
Text(AppLocalizations.of(context)!.checkHostFiltered)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
),
|
|
||||||
]
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 5),
|
backgroundColor: Colors.transparent,
|
||||||
] : [],
|
isScrollControlled: true
|
||||||
bottom: TabBar(
|
);
|
||||||
controller: tabController,
|
}
|
||||||
isScrollable: true,
|
},
|
||||||
unselectedLabelColor: Theme.of(context).colorScheme.onSurfaceVariant,
|
icon: const Icon(Icons.update_rounded),
|
||||||
tabs: [
|
tooltip: AppLocalizations.of(context)!.updateFrequency,
|
||||||
Tab(
|
),
|
||||||
child: Row(
|
PopupMenuButton(
|
||||||
mainAxisSize: MainAxisSize.min,
|
itemBuilder: (context) => [
|
||||||
children: [
|
PopupMenuItem(
|
||||||
const Icon(Icons.verified_user_rounded),
|
onTap: fetchUpdateLists,
|
||||||
const SizedBox(width: 8),
|
child: Row(
|
||||||
Text(AppLocalizations.of(context)!.whitelists,)
|
children: [
|
||||||
],
|
const Icon(Icons.sync_rounded),
|
||||||
),
|
const SizedBox(width: 10),
|
||||||
),
|
Text(AppLocalizations.of(context)!.updateLists)
|
||||||
Tab(
|
],
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
const Icon(Icons.gpp_bad_rounded),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
Text(AppLocalizations.of(context)!.blacklists)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Tab(
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
const Icon(Icons.shield_rounded),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
Text(AppLocalizations.of(context)!.customRules)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
PopupMenuItem(
|
||||||
];
|
onTap: openBlockedServicesModal,
|
||||||
}),
|
child: Row(
|
||||||
body: TabBarView(
|
children: [
|
||||||
controller: tabController,
|
const Icon(Icons.block),
|
||||||
children: [
|
const SizedBox(width: 10),
|
||||||
FiltersList(
|
Text(AppLocalizations.of(context)!.blockedServices)
|
||||||
loadStatus: serversProvider.filtering.loadStatus,
|
],
|
||||||
scrollController: scrollController,
|
)
|
||||||
type: 'whitelist',
|
),
|
||||||
data: serversProvider.filtering.loadStatus == LoadStatus.loaded
|
PopupMenuItem(
|
||||||
? serversProvider.filtering.data!.whitelistFilters : [],
|
onTap: showCheckHostModal,
|
||||||
fetchData: fetchFilters,
|
child: Row(
|
||||||
),
|
children: [
|
||||||
FiltersList(
|
const Icon(Icons.shield_rounded),
|
||||||
loadStatus: serversProvider.filtering.loadStatus,
|
const SizedBox(width: 10),
|
||||||
scrollController: scrollController,
|
Text(AppLocalizations.of(context)!.checkHostFiltered)
|
||||||
type: 'blacklist',
|
],
|
||||||
data: serversProvider.filtering.loadStatus == LoadStatus.loaded
|
)
|
||||||
? serversProvider.filtering.data!.filters : [],
|
),
|
||||||
fetchData: fetchFilters,
|
]
|
||||||
),
|
),
|
||||||
CustomRulesList(
|
const SizedBox(width: 5),
|
||||||
loadStatus: serversProvider.filtering.loadStatus,
|
];
|
||||||
scrollController: scrollController,
|
}
|
||||||
data: serversProvider.filtering.loadStatus == LoadStatus.loaded
|
else {
|
||||||
? serversProvider.filtering.data!.userRules : [],
|
return [];
|
||||||
fetchData: fetchFilters,
|
}
|
||||||
),
|
}
|
||||||
]
|
|
||||||
)
|
if (width > 1200) {
|
||||||
)
|
return FiltersTripleColumn(
|
||||||
);
|
onRemoveCustomRule: openRemoveCustomRuleModal,
|
||||||
|
onOpenDetailsModal: openListDetails,
|
||||||
|
actions: actions(),
|
||||||
|
refreshData: fetchFilters,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return FiltersTabsView(
|
||||||
|
appConfigProvider: appConfigProvider,
|
||||||
|
fetchFilters: fetchFilters,
|
||||||
|
actions: actions(),
|
||||||
|
onRemoveCustomRule: openRemoveCustomRuleModal,
|
||||||
|
onOpenDetailsModal: openListDetails,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,8 +7,7 @@ import 'package:provider/provider.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/screens/filters/fab.dart';
|
import 'package:adguard_home_manager/screens/filters/add_button.dart';
|
||||||
import 'package:adguard_home_manager/screens/filters/list_details_screen.dart';
|
|
||||||
import 'package:adguard_home_manager/widgets/custom_list_tile.dart';
|
import 'package:adguard_home_manager/widgets/custom_list_tile.dart';
|
||||||
import 'package:adguard_home_manager/widgets/tab_content_list.dart';
|
import 'package:adguard_home_manager/widgets/tab_content_list.dart';
|
||||||
|
|
||||||
|
@ -23,6 +22,7 @@ class FiltersList extends StatefulWidget {
|
||||||
final List<Filter> data;
|
final List<Filter> data;
|
||||||
final Future<void> Function() fetchData;
|
final Future<void> Function() fetchData;
|
||||||
final String type;
|
final String type;
|
||||||
|
final void Function(Filter, String) onOpenDetailsScreen;
|
||||||
|
|
||||||
const FiltersList({
|
const FiltersList({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -31,6 +31,7 @@ class FiltersList extends StatefulWidget {
|
||||||
required this.data,
|
required this.data,
|
||||||
required this.fetchData,
|
required this.fetchData,
|
||||||
required this.type,
|
required this.type,
|
||||||
|
required this.onOpenDetailsScreen
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -64,17 +65,6 @@ class _FiltersListState extends State<FiltersList> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
||||||
|
|
||||||
void openDetailsModal(Filter filter) {
|
|
||||||
Navigator.of(context).push(
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) => ListDetailsScreen(
|
|
||||||
list: filter,
|
|
||||||
type: widget.type,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return CustomTabContentList(
|
return CustomTabContentList(
|
||||||
loadingGenerator: () => SizedBox(
|
loadingGenerator: () => SizedBox(
|
||||||
|
@ -112,7 +102,7 @@ class _FiltersListState extends State<FiltersList> {
|
||||||
? Colors.grey
|
? Colors.grey
|
||||||
: Colors.red
|
: Colors.red
|
||||||
),
|
),
|
||||||
onTap: () => openDetailsModal(widget.data[index]),
|
onTap: () => widget.onOpenDetailsScreen(widget.data[index], widget.type),
|
||||||
),
|
),
|
||||||
noData: Container(
|
noData: Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
|
@ -166,8 +156,12 @@ class _FiltersListState extends State<FiltersList> {
|
||||||
),
|
),
|
||||||
loadStatus: widget.loadStatus,
|
loadStatus: widget.loadStatus,
|
||||||
onRefresh: widget.fetchData,
|
onRefresh: widget.fetchData,
|
||||||
fab: FiltersFab(
|
fab: AddFiltersButton(
|
||||||
type: widget.type,
|
type: widget.type,
|
||||||
|
widget: (fn) => FloatingActionButton(
|
||||||
|
onPressed: fn,
|
||||||
|
child: const Icon(Icons.add),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
fabVisible: isVisible,
|
fabVisible: isVisible,
|
||||||
);
|
);
|
||||||
|
|
143
lib/screens/filters/filters_tabs_view.dart
Normal file
143
lib/screens/filters/filters_tabs_view.dart
Normal file
|
@ -0,0 +1,143 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
|
import 'package:adguard_home_manager/screens/filters/custom_rules_list.dart';
|
||||||
|
import 'package:adguard_home_manager/screens/filters/filters_list.dart';
|
||||||
|
|
||||||
|
import 'package:adguard_home_manager/constants/enums.dart';
|
||||||
|
import 'package:adguard_home_manager/models/filtering.dart';
|
||||||
|
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
||||||
|
import 'package:adguard_home_manager/providers/servers_provider.dart';
|
||||||
|
|
||||||
|
class FiltersTabsView extends StatefulWidget {
|
||||||
|
final AppConfigProvider appConfigProvider;
|
||||||
|
final Future Function() fetchFilters;
|
||||||
|
final List<Widget> actions;
|
||||||
|
final void Function(String) onRemoveCustomRule;
|
||||||
|
final void Function(Filter, String) onOpenDetailsModal;
|
||||||
|
|
||||||
|
const FiltersTabsView({
|
||||||
|
Key? key,
|
||||||
|
required this.appConfigProvider,
|
||||||
|
required this.fetchFilters,
|
||||||
|
required this.actions,
|
||||||
|
required this.onOpenDetailsModal,
|
||||||
|
required this.onRemoveCustomRule
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<FiltersTabsView> createState() => _FiltersTabsViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FiltersTabsViewState extends State<FiltersTabsView> with TickerProviderStateMixin {
|
||||||
|
late TabController tabController;
|
||||||
|
final ScrollController scrollController = ScrollController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
widget.fetchFilters();
|
||||||
|
super.initState();
|
||||||
|
tabController = TabController(
|
||||||
|
initialIndex: 0,
|
||||||
|
length: 3,
|
||||||
|
vsync: this,
|
||||||
|
);
|
||||||
|
tabController.addListener(() => widget.appConfigProvider.setSelectedFiltersTab(tabController.index));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final serversProvider = Provider.of<ServersProvider>(context);
|
||||||
|
|
||||||
|
return DefaultTabController(
|
||||||
|
length: 3,
|
||||||
|
child: NestedScrollView(
|
||||||
|
controller: scrollController,
|
||||||
|
headerSliverBuilder: ((context, innerBoxIsScrolled) {
|
||||||
|
return [
|
||||||
|
SliverOverlapAbsorber(
|
||||||
|
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||||
|
sliver: SliverAppBar(
|
||||||
|
title: Text(AppLocalizations.of(context)!.filters),
|
||||||
|
pinned: true,
|
||||||
|
floating: true,
|
||||||
|
forceElevated: innerBoxIsScrolled,
|
||||||
|
centerTitle: false,
|
||||||
|
actions: widget.actions,
|
||||||
|
bottom: TabBar(
|
||||||
|
controller: tabController,
|
||||||
|
isScrollable: true,
|
||||||
|
unselectedLabelColor: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
tabs: [
|
||||||
|
Tab(
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.verified_user_rounded),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(AppLocalizations.of(context)!.whitelists,)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Tab(
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.gpp_bad_rounded),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(AppLocalizations.of(context)!.blacklists)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Tab(
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.shield_rounded),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(AppLocalizations.of(context)!.customRules)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
),
|
||||||
|
)
|
||||||
|
];
|
||||||
|
}),
|
||||||
|
body: TabBarView(
|
||||||
|
controller: tabController,
|
||||||
|
children: [
|
||||||
|
FiltersList(
|
||||||
|
loadStatus: serversProvider.filtering.loadStatus,
|
||||||
|
scrollController: scrollController,
|
||||||
|
type: 'whitelist',
|
||||||
|
data: serversProvider.filtering.loadStatus == LoadStatus.loaded
|
||||||
|
? serversProvider.filtering.data!.whitelistFilters : [],
|
||||||
|
fetchData: widget.fetchFilters,
|
||||||
|
onOpenDetailsScreen: widget.onOpenDetailsModal,
|
||||||
|
),
|
||||||
|
FiltersList(
|
||||||
|
loadStatus: serversProvider.filtering.loadStatus,
|
||||||
|
scrollController: scrollController,
|
||||||
|
type: 'blacklist',
|
||||||
|
data: serversProvider.filtering.loadStatus == LoadStatus.loaded
|
||||||
|
? serversProvider.filtering.data!.filters : [],
|
||||||
|
fetchData: widget.fetchFilters,
|
||||||
|
onOpenDetailsScreen: widget.onOpenDetailsModal,
|
||||||
|
),
|
||||||
|
CustomRulesList(
|
||||||
|
loadStatus: serversProvider.filtering.loadStatus,
|
||||||
|
scrollController: scrollController,
|
||||||
|
data: serversProvider.filtering.loadStatus == LoadStatus.loaded
|
||||||
|
? serversProvider.filtering.data!.userRules : [],
|
||||||
|
fetchData: widget.fetchFilters,
|
||||||
|
onRemoveCustomRule: widget.onRemoveCustomRule,
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
311
lib/screens/filters/filters_triple_column.dart
Normal file
311
lib/screens/filters/filters_triple_column.dart
Normal file
|
@ -0,0 +1,311 @@
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:adguard_home_manager/screens/filters/add_button.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import 'package:adguard_home_manager/widgets/custom_list_tile.dart';
|
||||||
|
|
||||||
|
import 'package:adguard_home_manager/constants/enums.dart';
|
||||||
|
import 'package:adguard_home_manager/models/filtering.dart';
|
||||||
|
import 'package:adguard_home_manager/functions/number_format.dart';
|
||||||
|
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
||||||
|
import 'package:adguard_home_manager/providers/servers_provider.dart';
|
||||||
|
|
||||||
|
class FiltersTripleColumn extends StatelessWidget {
|
||||||
|
final void Function(String) onRemoveCustomRule;
|
||||||
|
final void Function(Filter, String) onOpenDetailsModal;
|
||||||
|
final List<Widget> actions;
|
||||||
|
final Future Function() refreshData;
|
||||||
|
|
||||||
|
const FiltersTripleColumn({
|
||||||
|
Key? key,
|
||||||
|
required this.onRemoveCustomRule,
|
||||||
|
required this.onOpenDetailsModal,
|
||||||
|
required this.actions,
|
||||||
|
required this.refreshData
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final serversProvider = Provider.of<ServersProvider>(context);
|
||||||
|
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
||||||
|
|
||||||
|
bool checkIfComment(String value) {
|
||||||
|
final regex = RegExp(r'^(!|#).*$');
|
||||||
|
if (regex.hasMatch(value)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget? generateSubtitle(String rule) {
|
||||||
|
final allowRegex = RegExp(r'^@@.*$');
|
||||||
|
final blockRegex = RegExp(r'^\|\|.*$');
|
||||||
|
final commentRegex = RegExp(r'^(#|!).*$');
|
||||||
|
|
||||||
|
if (allowRegex.hasMatch(rule)) {
|
||||||
|
return Text(
|
||||||
|
AppLocalizations.of(context)!.allowed,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.green
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (blockRegex.hasMatch(rule)) {
|
||||||
|
return Text(
|
||||||
|
AppLocalizations.of(context)!.blocked,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.red
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (commentRegex.hasMatch(rule)) {
|
||||||
|
return Text(
|
||||||
|
AppLocalizations.of(context)!.comment,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.grey
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget content() {
|
||||||
|
switch (serversProvider.filtering.loadStatus) {
|
||||||
|
case LoadStatus.loading:
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const CircularProgressIndicator(),
|
||||||
|
const SizedBox(height: 30),
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context)!.loadingFilters,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 22,
|
||||||
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
case LoadStatus.loaded:
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context)!.whitelists,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: FontWeight.w500
|
||||||
|
),
|
||||||
|
),
|
||||||
|
AddFiltersButton(
|
||||||
|
type: 'whitelist',
|
||||||
|
widget: (fn) => IconButton(
|
||||||
|
onPressed: fn,
|
||||||
|
icon: const Icon(Icons.add_rounded)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: serversProvider.filtering.data!.whitelistFilters.length,
|
||||||
|
itemBuilder: (context, index) => CustomListTile(
|
||||||
|
title: serversProvider.filtering.data!.whitelistFilters[index].name,
|
||||||
|
subtitle: "${intFormat(serversProvider.filtering.data!.whitelistFilters[index].rulesCount, Platform.localeName)} ${AppLocalizations.of(context)!.enabledRules}",
|
||||||
|
trailing: Icon(
|
||||||
|
serversProvider.filtering.data!.whitelistFilters[index].enabled == true
|
||||||
|
? Icons.check_circle_rounded
|
||||||
|
: Icons.cancel,
|
||||||
|
color: serversProvider.filtering.data!.whitelistFilters[index].enabled == true
|
||||||
|
? appConfigProvider.useThemeColorForStatus == true
|
||||||
|
? Theme.of(context).colorScheme.primary
|
||||||
|
: Colors.green
|
||||||
|
: appConfigProvider.useThemeColorForStatus == true
|
||||||
|
? Colors.grey
|
||||||
|
: Colors.red
|
||||||
|
),
|
||||||
|
onTap: () => onOpenDetailsModal(serversProvider.filtering.data!.whitelistFilters[index], 'whitelist'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context)!.blacklists,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: FontWeight.w500
|
||||||
|
),
|
||||||
|
),
|
||||||
|
AddFiltersButton(
|
||||||
|
type: 'blacklist',
|
||||||
|
widget: (fn) => IconButton(
|
||||||
|
onPressed: fn,
|
||||||
|
icon: const Icon(Icons.add_rounded)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: serversProvider.filtering.data!.filters.length,
|
||||||
|
itemBuilder: (context, index) => CustomListTile(
|
||||||
|
title: serversProvider.filtering.data!.filters[index].name,
|
||||||
|
subtitle: "${intFormat(serversProvider.filtering.data!.filters[index].rulesCount, Platform.localeName)} ${AppLocalizations.of(context)!.enabledRules}",
|
||||||
|
trailing: Icon(
|
||||||
|
serversProvider.filtering.data!.filters[index].enabled == true
|
||||||
|
? Icons.check_circle_rounded
|
||||||
|
: Icons.cancel,
|
||||||
|
color: serversProvider.filtering.data!.filters[index].enabled == true
|
||||||
|
? appConfigProvider.useThemeColorForStatus == true
|
||||||
|
? Theme.of(context).colorScheme.primary
|
||||||
|
: Colors.green
|
||||||
|
: appConfigProvider.useThemeColorForStatus == true
|
||||||
|
? Colors.grey
|
||||||
|
: Colors.red
|
||||||
|
),
|
||||||
|
onTap: () => onOpenDetailsModal(serversProvider.filtering.data!.filters[index], 'blacklist'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context)!.customRules,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: FontWeight.w500
|
||||||
|
),
|
||||||
|
),
|
||||||
|
AddFiltersButton(
|
||||||
|
type: '',
|
||||||
|
widget: (fn) => IconButton(
|
||||||
|
onPressed: fn,
|
||||||
|
icon: const Icon(Icons.add_rounded)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: serversProvider.filtering.data!.userRules.length,
|
||||||
|
itemBuilder: (context, index) => ListTile(
|
||||||
|
title: Text(
|
||||||
|
serversProvider.filtering.data!.userRules[index],
|
||||||
|
style: TextStyle(
|
||||||
|
color: checkIfComment(serversProvider.filtering.data!.userRules[index]) == true
|
||||||
|
? Theme.of(context).colorScheme.onSurface.withOpacity(0.6)
|
||||||
|
: Theme.of(context).colorScheme.onSurface,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: generateSubtitle(serversProvider.filtering.data!.userRules[index]),
|
||||||
|
trailing: IconButton(
|
||||||
|
onPressed: () => onRemoveCustomRule(serversProvider.filtering.data!.userRules[index]),
|
||||||
|
icon: const Icon(Icons.delete)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
case LoadStatus.error:
|
||||||
|
return SizedBox.expand(
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.error,
|
||||||
|
color: Colors.red,
|
||||||
|
size: 50,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 30),
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context)!.filtersNotLoaded,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 22,
|
||||||
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
default:
|
||||||
|
return const SizedBox();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(AppLocalizations.of(context)!.filters),
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: refreshData,
|
||||||
|
icon: const Icon(Icons.refresh_rounded),
|
||||||
|
tooltip: AppLocalizations.of(context)!.refresh,
|
||||||
|
),
|
||||||
|
...actions
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: content(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,9 +7,9 @@ import 'package:flutter/rendering.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/screens/filters/filter_list_tile.dart';
|
|
||||||
import 'package:adguard_home_manager/screens/filters/add_list_modal.dart';
|
import 'package:adguard_home_manager/screens/filters/add_list_modal.dart';
|
||||||
import 'package:adguard_home_manager/screens/filters/delete_list_modal.dart';
|
import 'package:adguard_home_manager/screens/filters/delete_list_modal.dart';
|
||||||
|
import 'package:adguard_home_manager/widgets/custom_list_tile.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/functions/format_time.dart';
|
import 'package:adguard_home_manager/functions/format_time.dart';
|
||||||
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
||||||
|
@ -23,11 +23,13 @@ import 'package:adguard_home_manager/models/filtering.dart';
|
||||||
class ListDetailsScreen extends StatefulWidget {
|
class ListDetailsScreen extends StatefulWidget {
|
||||||
final Filter list;
|
final Filter list;
|
||||||
final String type;
|
final String type;
|
||||||
|
final bool dialog;
|
||||||
|
|
||||||
const ListDetailsScreen({
|
const ListDetailsScreen({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.list,
|
required this.list,
|
||||||
required this.type,
|
required this.type,
|
||||||
|
required this.dialog
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -218,122 +220,234 @@ class _ListDetailsScreenState extends State<ListDetailsScreen> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
List<Widget> content() {
|
||||||
appBar: AppBar(
|
return [
|
||||||
title: Text(AppLocalizations.of(context)!.listDetails),
|
CustomListTile(
|
||||||
actions: [
|
icon: Icons.shield_rounded,
|
||||||
IconButton(
|
title: AppLocalizations.of(context)!.currentStatus,
|
||||||
onPressed: () => {
|
subtitleWidget: Text(
|
||||||
if (width > 700 || !(Platform.isAndroid || Platform.isIOS)) {
|
enabled == true
|
||||||
showDialog(
|
? AppLocalizations.of(context)!.enabled
|
||||||
context: context,
|
: AppLocalizations.of(context)!.disabled,
|
||||||
builder: (ctx) => AddListModal(
|
style: TextStyle(
|
||||||
list: widget.list,
|
color: enabled == true
|
||||||
type: widget.type,
|
? appConfigProvider.useThemeColorForStatus == true
|
||||||
onEdit: confirmEditList,
|
? Theme.of(context).colorScheme.primary
|
||||||
dialog: true,
|
: Colors.green
|
||||||
),
|
: appConfigProvider.useThemeColorForStatus == true
|
||||||
)
|
? Colors.grey
|
||||||
}
|
: Colors.red,
|
||||||
else {
|
fontWeight: FontWeight.w500
|
||||||
showModalBottomSheet(
|
),
|
||||||
context: context,
|
|
||||||
builder: (ctx) => AddListModal(
|
|
||||||
list: widget.list,
|
|
||||||
type: widget.type,
|
|
||||||
onEdit: confirmEditList,
|
|
||||||
dialog: false,
|
|
||||||
),
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: Colors.transparent
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.edit),
|
|
||||||
tooltip: AppLocalizations.of(context)!.edit,
|
|
||||||
),
|
),
|
||||||
IconButton(
|
padding: widget.dialog == true
|
||||||
onPressed: () {
|
? const EdgeInsets.symmetric(
|
||||||
|
horizontal: 24,
|
||||||
|
vertical: 8
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
CustomListTile(
|
||||||
|
icon: Icons.badge_rounded,
|
||||||
|
title: AppLocalizations.of(context)!.name,
|
||||||
|
subtitle: name,
|
||||||
|
padding: widget.dialog == true
|
||||||
|
? const EdgeInsets.symmetric(
|
||||||
|
horizontal: 24,
|
||||||
|
vertical: 8
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
CustomListTile(
|
||||||
|
icon: Icons.link_rounded,
|
||||||
|
title: "URL",
|
||||||
|
subtitle: widget.list.url,
|
||||||
|
padding: widget.dialog == true
|
||||||
|
? const EdgeInsets.symmetric(
|
||||||
|
horizontal: 24,
|
||||||
|
vertical: 8
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
CustomListTile(
|
||||||
|
icon: Icons.list_rounded,
|
||||||
|
title: AppLocalizations.of(context)!.rules,
|
||||||
|
subtitle: widget.list.rulesCount.toString(),
|
||||||
|
padding: widget.dialog == true
|
||||||
|
? const EdgeInsets.symmetric(
|
||||||
|
horizontal: 24,
|
||||||
|
vertical: 8
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
CustomListTile(
|
||||||
|
icon: Icons.shield_rounded,
|
||||||
|
title: AppLocalizations.of(context)!.listType,
|
||||||
|
subtitle: widget.type == 'whitelist'
|
||||||
|
? AppLocalizations.of(context)!.whitelist
|
||||||
|
: AppLocalizations.of(context)!.blacklist,
|
||||||
|
padding: widget.dialog == true
|
||||||
|
? const EdgeInsets.symmetric(
|
||||||
|
horizontal: 24,
|
||||||
|
vertical: 8
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
if (widget.list.lastUpdated != null) CustomListTile(
|
||||||
|
icon: Icons.schedule_rounded,
|
||||||
|
title: AppLocalizations.of(context)!.latestUpdate,
|
||||||
|
subtitle: convertTimestampLocalTimezone(widget.list.lastUpdated!, 'dd-MM-yyyy HH:mm'),
|
||||||
|
padding: widget.dialog == true
|
||||||
|
? const EdgeInsets.symmetric(
|
||||||
|
horizontal: 24,
|
||||||
|
vertical: 8
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
if (widget.dialog == true) Container(height: 16)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Widget> actions() {
|
||||||
|
return [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () => {
|
||||||
|
if (width > 700 || !(Platform.isAndroid || Platform.isIOS)) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => DeleteListModal(
|
builder: (ctx) => AddListModal(
|
||||||
onConfirm: () => deleteList(widget.list, widget.type),
|
list: widget.list,
|
||||||
)
|
type: widget.type,
|
||||||
);
|
onEdit: confirmEditList,
|
||||||
},
|
dialog: true,
|
||||||
icon: const Icon(Icons.delete),
|
),
|
||||||
tooltip: AppLocalizations.of(context)!.delete,
|
)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
builder: (ctx) => AddListModal(
|
||||||
|
list: widget.list,
|
||||||
|
type: widget.type,
|
||||||
|
onEdit: confirmEditList,
|
||||||
|
dialog: false,
|
||||||
|
),
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Colors.transparent
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.edit),
|
||||||
|
tooltip: AppLocalizations.of(context)!.edit,
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => DeleteListModal(
|
||||||
|
onConfirm: () => deleteList(widget.list, widget.type),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.delete),
|
||||||
|
tooltip: AppLocalizations.of(context)!.delete,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (widget.dialog == true) {
|
||||||
|
return Dialog(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(
|
||||||
|
maxWidth: 500
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
child: Column(
|
||||||
],
|
mainAxisSize: MainAxisSize.min,
|
||||||
),
|
|
||||||
body: Stack(
|
|
||||||
children: [
|
|
||||||
ListView(
|
|
||||||
children: [
|
children: [
|
||||||
FilterListTile(
|
Padding(
|
||||||
icon: Icons.shield_rounded,
|
padding: const EdgeInsets.all(16),
|
||||||
title: AppLocalizations.of(context)!.currentStatus,
|
child: Row(
|
||||||
subtitle: enabled == true
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
? AppLocalizations.of(context)!.enabled
|
children: [
|
||||||
: AppLocalizations.of(context)!.disabled,
|
Row(
|
||||||
color: enabled == true
|
children: [
|
||||||
? appConfigProvider.useThemeColorForStatus == true
|
IconButton(
|
||||||
? Theme.of(context).colorScheme.primary
|
onPressed: () => Navigator.pop(context),
|
||||||
: Colors.green
|
icon: const Icon(Icons.clear_rounded),
|
||||||
: appConfigProvider.useThemeColorForStatus == true
|
tooltip: AppLocalizations.of(context)!.close,
|
||||||
? Colors.grey
|
),
|
||||||
: Colors.red,
|
const SizedBox(width: 8),
|
||||||
bold: true,
|
Text(
|
||||||
),
|
AppLocalizations.of(context)!.listDetails,
|
||||||
FilterListTile(
|
style: const TextStyle(
|
||||||
icon: Icons.badge_rounded,
|
fontSize: 22
|
||||||
title: AppLocalizations.of(context)!.name,
|
),
|
||||||
subtitle: name
|
)
|
||||||
),
|
],
|
||||||
FilterListTile(
|
),
|
||||||
icon: Icons.link_rounded,
|
Row(
|
||||||
title: "URL",
|
children: [
|
||||||
subtitle: widget.list.url
|
IconButton(
|
||||||
),
|
onPressed: () => enableDisableList(widget.list, !enabled),
|
||||||
FilterListTile(
|
icon: Icon(
|
||||||
icon: Icons.list_rounded,
|
enabled == true
|
||||||
title: AppLocalizations.of(context)!.rules,
|
? Icons.gpp_bad_rounded
|
||||||
subtitle: widget.list.rulesCount.toString()
|
: Icons.verified_user_rounded,
|
||||||
),
|
),
|
||||||
FilterListTile(
|
tooltip: enabled == true
|
||||||
icon: Icons.shield_rounded,
|
? AppLocalizations.of(context)!.disableList
|
||||||
title: AppLocalizations.of(context)!.listType,
|
: AppLocalizations.of(context)!.enableList,
|
||||||
subtitle: widget.type == 'whitelist'
|
),
|
||||||
? AppLocalizations.of(context)!.whitelist
|
...actions()
|
||||||
: AppLocalizations.of(context)!.blacklist,
|
],
|
||||||
),
|
)
|
||||||
if (widget.list.lastUpdated != null) FilterListTile(
|
],
|
||||||
icon: Icons.schedule_rounded,
|
),
|
||||||
title: AppLocalizations.of(context)!.latestUpdate,
|
|
||||||
subtitle: convertTimestampLocalTimezone(widget.list.lastUpdated!, 'dd-MM-yyyy HH:mm'),
|
|
||||||
),
|
),
|
||||||
|
Flexible(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Wrap(
|
||||||
|
children: content(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
AnimatedPositioned(
|
)
|
||||||
duration: const Duration(milliseconds: 100),
|
);
|
||||||
curve: Curves.easeInOut,
|
}
|
||||||
bottom: fabVisible ?
|
else {
|
||||||
appConfigProvider.showingSnackbar
|
return Scaffold(
|
||||||
? 70 : (Platform.isIOS ? 40 : 20)
|
appBar: AppBar(
|
||||||
: -70,
|
title: Text(AppLocalizations.of(context)!.listDetails),
|
||||||
right: 20,
|
actions: actions(),
|
||||||
child: FloatingActionButton(
|
),
|
||||||
onPressed: () => enableDisableList(widget.list, !enabled),
|
body: Stack(
|
||||||
child: Icon(
|
children: [
|
||||||
enabled == true
|
ListView(
|
||||||
? Icons.gpp_bad_rounded
|
children: content(),
|
||||||
: Icons.verified_user_rounded,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
AnimatedPositioned(
|
||||||
],
|
duration: const Duration(milliseconds: 100),
|
||||||
),
|
curve: Curves.easeInOut,
|
||||||
);
|
bottom: fabVisible ?
|
||||||
|
appConfigProvider.showingSnackbar
|
||||||
|
? 70 : (Platform.isIOS ? 40 : 20)
|
||||||
|
: -70,
|
||||||
|
right: 20,
|
||||||
|
child: FloatingActionButton(
|
||||||
|
onPressed: () => enableDisableList(widget.list, !enabled),
|
||||||
|
child: Icon(
|
||||||
|
enabled == true
|
||||||
|
? Icons.gpp_bad_rounded
|
||||||
|
: Icons.verified_user_rounded,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -119,7 +119,7 @@ class SettingsWidget extends StatelessWidget {
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
children: [
|
children: [
|
||||||
if (serversProvider.selectedServer != null) ...[
|
if (serversProvider.selectedServer != null && serversProvider.serverStatus.data != null) ...[
|
||||||
SectionLabel(label: AppLocalizations.of(context)!.serverSettings),
|
SectionLabel(label: AppLocalizations.of(context)!.serverSettings),
|
||||||
if (serverVersionIsAhead(
|
if (serverVersionIsAhead(
|
||||||
currentVersion: serversProvider.serverStatus.data!.serverVersion,
|
currentVersion: serversProvider.serverStatus.data!.serverVersion,
|
||||||
|
|
|
@ -23,7 +23,7 @@ class CustomListTile extends StatelessWidget {
|
||||||
this.padding,
|
this.padding,
|
||||||
this.onLongPress,
|
this.onLongPress,
|
||||||
this.disabled,
|
this.disabled,
|
||||||
this.onHover
|
this.onHover,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <dynamic_color/dynamic_color_plugin.h>
|
#include <dynamic_color/dynamic_color_plugin.h>
|
||||||
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
||||||
|
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||||
#include <window_size/window_size_plugin.h>
|
#include <window_size/window_size_plugin.h>
|
||||||
|
|
||||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
|
@ -17,6 +18,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar =
|
g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin");
|
||||||
sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar);
|
sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar);
|
||||||
|
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
|
||||||
|
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) window_size_registrar =
|
g_autoptr(FlPluginRegistrar) window_size_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowSizePlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowSizePlugin");
|
||||||
window_size_plugin_register_with_registrar(window_size_registrar);
|
window_size_plugin_register_with_registrar(window_size_registrar);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
dynamic_color
|
dynamic_color
|
||||||
sqlite3_flutter_libs
|
sqlite3_flutter_libs
|
||||||
|
url_launcher_linux
|
||||||
window_size
|
window_size
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import dynamic_color
|
||||||
import package_info_plus_macos
|
import package_info_plus_macos
|
||||||
import sqflite
|
import sqflite
|
||||||
import sqlite3_flutter_libs
|
import sqlite3_flutter_libs
|
||||||
|
import url_launcher_macos
|
||||||
import window_size
|
import window_size
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
|
@ -18,5 +19,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
||||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||||
Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin"))
|
Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin"))
|
||||||
|
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||||
WindowSizePlugin.register(with: registry.registrar(forPlugin: "WindowSizePlugin"))
|
WindowSizePlugin.register(with: registry.registrar(forPlugin: "WindowSizePlugin"))
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,8 @@ PODS:
|
||||||
- sqlite3/fts5
|
- sqlite3/fts5
|
||||||
- sqlite3/perf-threadsafe
|
- sqlite3/perf-threadsafe
|
||||||
- sqlite3/rtree
|
- sqlite3/rtree
|
||||||
|
- url_launcher_macos (0.0.1):
|
||||||
|
- FlutterMacOS
|
||||||
- window_size (0.0.2):
|
- window_size (0.0.2):
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
|
|
||||||
|
@ -37,6 +39,7 @@ DEPENDENCIES:
|
||||||
- package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`)
|
- package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`)
|
||||||
- sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`)
|
- sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`)
|
||||||
- sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos`)
|
- sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos`)
|
||||||
|
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
||||||
- window_size (from `Flutter/ephemeral/.symlinks/plugins/window_size/macos`)
|
- window_size (from `Flutter/ephemeral/.symlinks/plugins/window_size/macos`)
|
||||||
|
|
||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
|
@ -57,6 +60,8 @@ EXTERNAL SOURCES:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos
|
||||||
sqlite3_flutter_libs:
|
sqlite3_flutter_libs:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos
|
||||||
|
url_launcher_macos:
|
||||||
|
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
|
||||||
window_size:
|
window_size:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/window_size/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/window_size/macos
|
||||||
|
|
||||||
|
@ -69,6 +74,7 @@ SPEC CHECKSUMS:
|
||||||
sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea
|
sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea
|
||||||
sqlite3: d31b2b69d59bd1b4ab30e5c92eb18fd8e82fa392
|
sqlite3: d31b2b69d59bd1b4ab30e5c92eb18fd8e82fa392
|
||||||
sqlite3_flutter_libs: f20746e4a0245afbee4f20d9afc0072ebff7cc26
|
sqlite3_flutter_libs: f20746e4a0245afbee4f20d9afc0072ebff7cc26
|
||||||
|
url_launcher_macos: 5335912b679c073563f29d89d33d10d459f95451
|
||||||
window_size: 339dafa0b27a95a62a843042038fa6c3c48de195
|
window_size: 339dafa0b27a95a62a843042038fa6c3c48de195
|
||||||
|
|
||||||
PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7
|
PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7
|
||||||
|
|
64
pubspec.lock
64
pubspec.lock
|
@ -675,6 +675,70 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.4"
|
version: "2.0.4"
|
||||||
|
url_launcher:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: url_launcher
|
||||||
|
sha256: "75f2846facd11168d007529d6cd8fcb2b750186bea046af9711f10b907e1587e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.10"
|
||||||
|
url_launcher_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_android
|
||||||
|
sha256: "22f8db4a72be26e9e3a4aa3f194b1f7afbc76d20ec141f84be1d787db2155cbd"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.0.31"
|
||||||
|
url_launcher_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_ios
|
||||||
|
sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.4"
|
||||||
|
url_launcher_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_linux
|
||||||
|
sha256: "207f4ddda99b95b4d4868320a352d374b0b7e05eefad95a4a26f57da413443f5"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.5"
|
||||||
|
url_launcher_macos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_macos
|
||||||
|
sha256: "91ee3e75ea9dadf38036200c5d3743518f4a5eb77a8d13fda1ee5764373f185e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.5"
|
||||||
|
url_launcher_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_platform_interface
|
||||||
|
sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.2"
|
||||||
|
url_launcher_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_web
|
||||||
|
sha256: "81fe91b6c4f84f222d186a9d23c73157dc4c8e1c71489c4d08be1ad3b228f1aa"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.16"
|
||||||
|
url_launcher_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_windows
|
||||||
|
sha256: "254708f17f7c20a9c8c471f67d86d76d4a3f9c1591aad1e15292008aceb82771"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.6"
|
||||||
uuid:
|
uuid:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -64,6 +64,7 @@ dependencies:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/JGeek00/flutter_split_view
|
url: https://github.com/JGeek00/flutter_split_view
|
||||||
ref: hide-divider
|
ref: hide-divider
|
||||||
|
url_launcher: ^6.1.10
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <dynamic_color/dynamic_color_plugin_c_api.h>
|
#include <dynamic_color/dynamic_color_plugin_c_api.h>
|
||||||
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
||||||
|
#include <url_launcher_windows/url_launcher_windows.h>
|
||||||
#include <window_size/window_size_plugin.h>
|
#include <window_size/window_size_plugin.h>
|
||||||
|
|
||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
|
@ -15,6 +16,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
|
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
|
||||||
Sqlite3FlutterLibsPluginRegisterWithRegistrar(
|
Sqlite3FlutterLibsPluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("Sqlite3FlutterLibsPlugin"));
|
registry->GetRegistrarForPlugin("Sqlite3FlutterLibsPlugin"));
|
||||||
|
UrlLauncherWindowsRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
|
||||||
WindowSizePluginRegisterWithRegistrar(
|
WindowSizePluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("WindowSizePlugin"));
|
registry->GetRegistrarForPlugin("WindowSizePlugin"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
dynamic_color
|
dynamic_color
|
||||||
sqlite3_flutter_libs
|
sqlite3_flutter_libs
|
||||||
|
url_launcher_windows
|
||||||
window_size
|
window_size
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue