mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-04 20:30:35 +00:00
Removed legacy code
This commit is contained in:
parent
e08404b140
commit
9363652622
9 changed files with 70 additions and 213 deletions
|
@ -84,7 +84,6 @@ class Client {
|
||||||
final bool filteringEnabled;
|
final bool filteringEnabled;
|
||||||
final bool parentalEnabled;
|
final bool parentalEnabled;
|
||||||
final bool safebrowsingEnabled;
|
final bool safebrowsingEnabled;
|
||||||
final bool? safesearchEnabled;
|
|
||||||
final bool useGlobalBlockedServices;
|
final bool useGlobalBlockedServices;
|
||||||
final bool useGlobalSettings;
|
final bool useGlobalSettings;
|
||||||
final SafeSearch? safeSearch;
|
final SafeSearch? safeSearch;
|
||||||
|
@ -98,7 +97,6 @@ class Client {
|
||||||
required this.filteringEnabled,
|
required this.filteringEnabled,
|
||||||
required this.parentalEnabled,
|
required this.parentalEnabled,
|
||||||
required this.safebrowsingEnabled,
|
required this.safebrowsingEnabled,
|
||||||
required this.safesearchEnabled,
|
|
||||||
required this.useGlobalBlockedServices,
|
required this.useGlobalBlockedServices,
|
||||||
required this.useGlobalSettings,
|
required this.useGlobalSettings,
|
||||||
required this.safeSearch,
|
required this.safeSearch,
|
||||||
|
@ -113,7 +111,6 @@ class Client {
|
||||||
filteringEnabled: json["filtering_enabled"],
|
filteringEnabled: json["filtering_enabled"],
|
||||||
parentalEnabled: json["parental_enabled"],
|
parentalEnabled: json["parental_enabled"],
|
||||||
safebrowsingEnabled: json["safebrowsing_enabled"],
|
safebrowsingEnabled: json["safebrowsing_enabled"],
|
||||||
safesearchEnabled: json["safesearch_enabled"],
|
|
||||||
useGlobalBlockedServices: json["use_global_blocked_services"],
|
useGlobalBlockedServices: json["use_global_blocked_services"],
|
||||||
useGlobalSettings: json["use_global_settings"],
|
useGlobalSettings: json["use_global_settings"],
|
||||||
safeSearch: json["safe_search"] != null
|
safeSearch: json["safe_search"] != null
|
||||||
|
@ -130,7 +127,6 @@ class Client {
|
||||||
"filtering_enabled": filteringEnabled,
|
"filtering_enabled": filteringEnabled,
|
||||||
"parental_enabled": parentalEnabled,
|
"parental_enabled": parentalEnabled,
|
||||||
"safebrowsing_enabled": safebrowsingEnabled,
|
"safebrowsing_enabled": safebrowsingEnabled,
|
||||||
"safesearch_enabled": safesearchEnabled,
|
|
||||||
"safe_search": safeSearch,
|
"safe_search": safeSearch,
|
||||||
"use_global_blocked_services": useGlobalBlockedServices,
|
"use_global_blocked_services": useGlobalBlockedServices,
|
||||||
"use_global_settings": useGlobalSettings,
|
"use_global_settings": useGlobalSettings,
|
||||||
|
|
|
@ -142,13 +142,7 @@ class ClientsProvider with ChangeNotifier {
|
||||||
final result = await _serversProvider!.apiClient2!.postUpdateClient(
|
final result = await _serversProvider!.apiClient2!.postUpdateClient(
|
||||||
data: {
|
data: {
|
||||||
'name': client.name,
|
'name': client.name,
|
||||||
'data': serverVersionIsAhead(
|
'data': removePropFromMap(client.toJson(), 'safe_search')
|
||||||
currentVersion: _statusProvider!.serverStatus!.serverVersion,
|
|
||||||
referenceVersion: 'v0.107.28',
|
|
||||||
referenceVersionBeta: 'v0.108.0-b.33'
|
|
||||||
) == false
|
|
||||||
? removePropFromMap(client.toJson(), 'safesearch_enabled')
|
|
||||||
: removePropFromMap(client.toJson(), 'safe_search')
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -175,13 +169,7 @@ class ClientsProvider with ChangeNotifier {
|
||||||
|
|
||||||
Future<bool> addClient(Client client) async {
|
Future<bool> addClient(Client client) async {
|
||||||
final result = await _serversProvider!.apiClient2!.postAddClient(
|
final result = await _serversProvider!.apiClient2!.postAddClient(
|
||||||
data: serverVersionIsAhead(
|
data: removePropFromMap(client.toJson(), 'safe_search')
|
||||||
currentVersion: _statusProvider!.serverStatus!.serverVersion,
|
|
||||||
referenceVersion: 'v0.107.28',
|
|
||||||
referenceVersionBeta: 'v0.108.0-b.33'
|
|
||||||
) == false
|
|
||||||
? removePropFromMap(client.toJson(), 'safesearch_enabled')
|
|
||||||
: removePropFromMap(client.toJson(), 'safe_search')
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (result.successful == true) {
|
if (result.successful == true) {
|
||||||
|
|
|
@ -5,8 +5,6 @@ import 'package:flutter_gen/gen_l10n/app_localizations.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/providers/status_provider.dart';
|
|
||||||
import 'package:adguard_home_manager/functions/compare_versions.dart';
|
|
||||||
import 'package:adguard_home_manager/functions/copy_clipboard.dart';
|
import 'package:adguard_home_manager/functions/copy_clipboard.dart';
|
||||||
import 'package:adguard_home_manager/models/clients.dart';
|
import 'package:adguard_home_manager/models/clients.dart';
|
||||||
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
||||||
|
@ -21,7 +19,7 @@ class AddedClientTile extends StatelessWidget {
|
||||||
final bool? splitView;
|
final bool? splitView;
|
||||||
|
|
||||||
const AddedClientTile({
|
const AddedClientTile({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.client,
|
required this.client,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
required this.onLongPress,
|
required this.onLongPress,
|
||||||
|
@ -29,11 +27,10 @@ class AddedClientTile extends StatelessWidget {
|
||||||
required this.onDelete,
|
required this.onDelete,
|
||||||
this.selectedClient,
|
this.selectedClient,
|
||||||
required this.splitView,
|
required this.splitView,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final statusProvider = Provider.of<StatusProvider>(context);
|
|
||||||
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
||||||
|
|
||||||
if (splitView == true) {
|
if (splitView == true) {
|
||||||
|
@ -146,25 +143,13 @@ class AddedClientTile extends StatelessWidget {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.search_rounded,
|
Icons.search_rounded,
|
||||||
size: 19,
|
size: 19,
|
||||||
color: serverVersionIsAhead(
|
color: client.safeSearch != null && client.safeSearch!.enabled == true
|
||||||
currentVersion: statusProvider.serverStatus!.serverVersion,
|
? appConfigProvider.useThemeColorForStatus == true
|
||||||
referenceVersion: 'v0.107.28',
|
? Theme.of(context).colorScheme.primary
|
||||||
referenceVersionBeta: 'v0.108.0-b.33'
|
: Colors.green
|
||||||
) == true
|
: appConfigProvider.useThemeColorForStatus == true
|
||||||
? client.safeSearch != null && client.safeSearch!.enabled == true
|
? Colors.grey
|
||||||
? appConfigProvider.useThemeColorForStatus == true
|
: Colors.red
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Colors.green
|
|
||||||
: appConfigProvider.useThemeColorForStatus == true
|
|
||||||
? Colors.grey
|
|
||||||
: Colors.red
|
|
||||||
: client.safesearchEnabled == true
|
|
||||||
? appConfigProvider.useThemeColorForStatus == true
|
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Colors.green
|
|
||||||
: appConfigProvider.useThemeColorForStatus == true
|
|
||||||
? Colors.grey
|
|
||||||
: Colors.red,
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -260,25 +245,13 @@ class AddedClientTile extends StatelessWidget {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.search_rounded,
|
Icons.search_rounded,
|
||||||
size: 19,
|
size: 19,
|
||||||
color: serverVersionIsAhead(
|
color: client.safeSearch != null && client.safeSearch!.enabled == true
|
||||||
currentVersion: statusProvider.serverStatus!.serverVersion,
|
? appConfigProvider.useThemeColorForStatus == true
|
||||||
referenceVersion: 'v0.107.28',
|
? Theme.of(context).colorScheme.primary
|
||||||
referenceVersionBeta: 'v0.108.0-b.33'
|
: Colors.green
|
||||||
) == true
|
: appConfigProvider.useThemeColorForStatus == true
|
||||||
? client.safeSearch != null && client.safeSearch!.enabled == true
|
? Colors.grey
|
||||||
? appConfigProvider.useThemeColorForStatus == true
|
: Colors.red
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Colors.green
|
|
||||||
: appConfigProvider.useThemeColorForStatus == true
|
|
||||||
? Colors.grey
|
|
||||||
: Colors.red
|
|
||||||
: client.safesearchEnabled == true
|
|
||||||
? appConfigProvider.useThemeColorForStatus == true
|
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Colors.green
|
|
||||||
: appConfigProvider.useThemeColorForStatus == true
|
|
||||||
? Colors.grey
|
|
||||||
: Colors.red,
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.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/clients/client/blocked_services_section.dart';
|
import 'package:adguard_home_manager/screens/clients/client/blocked_services_section.dart';
|
||||||
|
@ -15,10 +14,8 @@ import 'package:adguard_home_manager/screens/clients/client/upstream_servers_sec
|
||||||
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/section_label.dart';
|
import 'package:adguard_home_manager/widgets/section_label.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/functions/compare_versions.dart';
|
|
||||||
import 'package:adguard_home_manager/models/clients.dart';
|
import 'package:adguard_home_manager/models/clients.dart';
|
||||||
import 'package:adguard_home_manager/models/safe_search.dart';
|
import 'package:adguard_home_manager/models/safe_search.dart';
|
||||||
import 'package:adguard_home_manager/providers/status_provider.dart';
|
|
||||||
|
|
||||||
class ClientForm extends StatelessWidget {
|
class ClientForm extends StatelessWidget {
|
||||||
final bool isFullScreen;
|
final bool isFullScreen;
|
||||||
|
@ -82,8 +79,6 @@ class ClientForm extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final statusProvider = Provider.of<StatusProvider>(context);
|
|
||||||
|
|
||||||
return ListView(
|
return ListView(
|
||||||
padding: const EdgeInsets.only(top: 0),
|
padding: const EdgeInsets.only(top: 0),
|
||||||
children: [
|
children: [
|
||||||
|
@ -195,13 +190,7 @@ class ClientForm extends StatelessWidget {
|
||||||
onChange: (value) => updateEnableParentalControl(value),
|
onChange: (value) => updateEnableParentalControl(value),
|
||||||
useGlobalSettingsFiltering: useGlobalSettingsFiltering,
|
useGlobalSettingsFiltering: useGlobalSettingsFiltering,
|
||||||
),
|
),
|
||||||
if (
|
CustomListTile(
|
||||||
serverVersionIsAhead(
|
|
||||||
currentVersion: statusProvider.serverStatus!.serverVersion,
|
|
||||||
referenceVersion: 'v0.107.28',
|
|
||||||
referenceVersionBeta: 'v0.108.0-b.33'
|
|
||||||
) == true
|
|
||||||
) CustomListTile(
|
|
||||||
title: AppLocalizations.of(context)!.safeSearch,
|
title: AppLocalizations.of(context)!.safeSearch,
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 42,
|
horizontal: 42,
|
||||||
|
@ -226,18 +215,6 @@ class ClientForm extends StatelessWidget {
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
if (
|
|
||||||
serverVersionIsAhead(
|
|
||||||
currentVersion: statusProvider.serverStatus!.serverVersion,
|
|
||||||
referenceVersion: 'v0.107.28',
|
|
||||||
referenceVersionBeta: 'v0.108.0-b.33'
|
|
||||||
) == false
|
|
||||||
) SettingsTile(
|
|
||||||
label: AppLocalizations.of(context)!.enableSafeSearch,
|
|
||||||
value: enableSafeSearch,
|
|
||||||
onChange: (value) => updateEnableSafeSearch(value),
|
|
||||||
useGlobalSettingsFiltering: useGlobalSettingsFiltering,
|
|
||||||
),
|
|
||||||
SectionLabel(
|
SectionLabel(
|
||||||
label: AppLocalizations.of(context)!.blockedServices,
|
label: AppLocalizations.of(context)!.blockedServices,
|
||||||
padding: const EdgeInsets.all(24),
|
padding: const EdgeInsets.all(24),
|
||||||
|
|
|
@ -6,10 +6,8 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
import 'package:adguard_home_manager/screens/clients/client/client_form.dart';
|
import 'package:adguard_home_manager/screens/clients/client/client_form.dart';
|
||||||
import 'package:adguard_home_manager/screens/clients/client/client_screen_functions.dart';
|
import 'package:adguard_home_manager/screens/clients/client/client_screen_functions.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/functions/compare_versions.dart';
|
|
||||||
import 'package:adguard_home_manager/models/safe_search.dart';
|
import 'package:adguard_home_manager/models/safe_search.dart';
|
||||||
import 'package:adguard_home_manager/providers/clients_provider.dart';
|
import 'package:adguard_home_manager/providers/clients_provider.dart';
|
||||||
import 'package:adguard_home_manager/providers/status_provider.dart';
|
|
||||||
import 'package:adguard_home_manager/models/clients.dart';
|
import 'package:adguard_home_manager/models/clients.dart';
|
||||||
|
|
||||||
class ControllerListItem {
|
class ControllerListItem {
|
||||||
|
@ -75,8 +73,6 @@ class _ClientScreenState extends State<ClientScreen> {
|
||||||
|
|
||||||
List<ControllerListItem> upstreamServers = [];
|
List<ControllerListItem> upstreamServers = [];
|
||||||
|
|
||||||
bool version = false;
|
|
||||||
|
|
||||||
void enableDisableGlobalSettingsFiltering() {
|
void enableDisableGlobalSettingsFiltering() {
|
||||||
if (useGlobalSettingsFiltering == true) {
|
if (useGlobalSettingsFiltering == true) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
@ -104,12 +100,6 @@ class _ClientScreenState extends State<ClientScreen> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
version = serverVersionIsAhead(
|
|
||||||
currentVersion: Provider.of<StatusProvider>(context, listen: false).serverStatus!.serverVersion,
|
|
||||||
referenceVersion: 'v0.107.28',
|
|
||||||
referenceVersionBeta: 'v0.108.0-b.33'
|
|
||||||
);
|
|
||||||
|
|
||||||
if (widget.client != null) {
|
if (widget.client != null) {
|
||||||
validValues = true;
|
validValues = true;
|
||||||
|
|
||||||
|
@ -123,12 +113,7 @@ class _ClientScreenState extends State<ClientScreen> {
|
||||||
enableFiltering = widget.client!.filteringEnabled;
|
enableFiltering = widget.client!.filteringEnabled;
|
||||||
enableParentalControl = widget.client!.parentalEnabled;
|
enableParentalControl = widget.client!.parentalEnabled;
|
||||||
enableSafeBrowsing = widget.client!.safebrowsingEnabled;
|
enableSafeBrowsing = widget.client!.safebrowsingEnabled;
|
||||||
if (version == true) {
|
safeSearch = widget.client!.safeSearch;
|
||||||
safeSearch = widget.client!.safeSearch;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
enableSafeSearch = widget.client!.safesearchEnabled ?? false;
|
|
||||||
}
|
|
||||||
useGlobalSettingsServices = widget.client!.useGlobalBlockedServices;
|
useGlobalSettingsServices = widget.client!.useGlobalBlockedServices;
|
||||||
blockedServices = widget.client!.blockedServices;
|
blockedServices = widget.client!.blockedServices;
|
||||||
upstreamServers = widget.client!.upstreams.map((e) => ControllerListItem(
|
upstreamServers = widget.client!.upstreams.map((e) => ControllerListItem(
|
||||||
|
@ -151,8 +136,7 @@ class _ClientScreenState extends State<ClientScreen> {
|
||||||
filteringEnabled: enableFiltering ?? false,
|
filteringEnabled: enableFiltering ?? false,
|
||||||
parentalEnabled: enableParentalControl ?? false,
|
parentalEnabled: enableParentalControl ?? false,
|
||||||
safebrowsingEnabled: enableSafeBrowsing ?? false,
|
safebrowsingEnabled: enableSafeBrowsing ?? false,
|
||||||
safesearchEnabled: version == false ? enableSafeSearch : null,
|
safeSearch: safeSearch,
|
||||||
safeSearch: version == true ? safeSearch : null,
|
|
||||||
useGlobalBlockedServices: useGlobalSettingsServices,
|
useGlobalBlockedServices: useGlobalSettingsServices,
|
||||||
blockedServices: blockedServices,
|
blockedServices: blockedServices,
|
||||||
upstreams: List<String>.from(upstreamServers.map((e) => e.controller.text)),
|
upstreams: List<String>.from(upstreamServers.map((e) => e.controller.text)),
|
||||||
|
|
|
@ -290,25 +290,13 @@ class _SearchClientsState extends State<SearchClients> {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.search_rounded,
|
Icons.search_rounded,
|
||||||
size: 19,
|
size: 19,
|
||||||
color: serverVersionIsAhead(
|
color: clientsScreen[index].safeSearch != null && clientsScreen[index].safeSearch!.enabled == true
|
||||||
currentVersion: statusProvider.serverStatus!.serverVersion,
|
? appConfigProvider.useThemeColorForStatus == true
|
||||||
referenceVersion: 'v0.107.28',
|
? Theme.of(context).colorScheme.primary
|
||||||
referenceVersionBeta: 'v0.108.0-b.33'
|
: Colors.green
|
||||||
) == true
|
: appConfigProvider.useThemeColorForStatus == true
|
||||||
? clientsScreen[index].safeSearch != null && clientsScreen[index].safeSearch!.enabled == true
|
? Colors.grey
|
||||||
? appConfigProvider.useThemeColorForStatus == true
|
: Colors.red
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Colors.green
|
|
||||||
: appConfigProvider.useThemeColorForStatus == true
|
|
||||||
? Colors.grey
|
|
||||||
: Colors.red
|
|
||||||
: clientsScreen[index].safesearchEnabled == true
|
|
||||||
? appConfigProvider.useThemeColorForStatus == true
|
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Colors.green
|
|
||||||
: appConfigProvider.useThemeColorForStatus == true
|
|
||||||
? Colors.grey
|
|
||||||
: Colors.red,
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -29,88 +29,55 @@ class MainSwitch extends StatelessWidget {
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
child: serverVersionIsAhead(
|
child: ExpandableNotifier(
|
||||||
currentVersion: statusProvider.serverStatus!.serverVersion,
|
controller: expandableController,
|
||||||
referenceVersion: 'v0.107.28',
|
child: Material(
|
||||||
referenceVersionBeta: 'v0.108.0-b.33'
|
color: Colors.transparent,
|
||||||
) == true
|
borderRadius: BorderRadius.circular(28),
|
||||||
? ExpandableNotifier(
|
child: InkWell(
|
||||||
controller: expandableController,
|
onTap: statusProvider.serverStatus!.generalEnabled == true && !statusProvider.protectionsManagementProcess.contains('general')
|
||||||
child: Material(
|
? () => expandableController.toggle()
|
||||||
color: Colors.transparent,
|
: null,
|
||||||
borderRadius: BorderRadius.circular(28),
|
borderRadius: BorderRadius.circular(28),
|
||||||
child: InkWell(
|
child: Container(
|
||||||
onTap: statusProvider.serverStatus!.generalEnabled == true && !statusProvider.protectionsManagementProcess.contains('general')
|
padding: const EdgeInsets.symmetric(
|
||||||
? () => expandableController.toggle()
|
horizontal: 20,
|
||||||
: null,
|
vertical: 12
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(28),
|
borderRadius: BorderRadius.circular(28),
|
||||||
child: Container(
|
color: Theme.of(context).colorScheme.primary.withOpacity(0.1)
|
||||||
padding: const EdgeInsets.symmetric(
|
),
|
||||||
horizontal: 20,
|
child: Expandable(
|
||||||
vertical: 12
|
theme: const ExpandableThemeData(
|
||||||
),
|
animationDuration: Duration(milliseconds: 200),
|
||||||
decoration: BoxDecoration(
|
fadeCurve: Curves.ease
|
||||||
borderRadius: BorderRadius.circular(28),
|
),
|
||||||
color: Theme.of(context).colorScheme.primary.withOpacity(0.1)
|
collapsed: _TopRow(
|
||||||
),
|
legacyMode: false,
|
||||||
child: Expandable(
|
expandableController: expandableController,
|
||||||
theme: const ExpandableThemeData(
|
updateBlocking: updateBlocking,
|
||||||
animationDuration: Duration(milliseconds: 200),
|
animation: animation,
|
||||||
fadeCurve: Curves.ease
|
),
|
||||||
),
|
expanded: Column(
|
||||||
collapsed: _TopRow(
|
children: [
|
||||||
|
_TopRow(
|
||||||
legacyMode: false,
|
legacyMode: false,
|
||||||
expandableController: expandableController,
|
expandableController: expandableController,
|
||||||
updateBlocking: updateBlocking,
|
updateBlocking: updateBlocking,
|
||||||
animation: animation,
|
animation: animation,
|
||||||
),
|
),
|
||||||
expanded: Column(
|
_BottomRow(
|
||||||
children: [
|
disableWithCountdown: disableWithCountdown,
|
||||||
_TopRow(
|
),
|
||||||
legacyMode: false,
|
const SizedBox(height: 8)
|
||||||
expandableController: expandableController,
|
],
|
||||||
updateBlocking: updateBlocking,
|
|
||||||
animation: animation,
|
|
||||||
),
|
|
||||||
_BottomRow(
|
|
||||||
disableWithCountdown: disableWithCountdown,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 8)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
: Material(
|
|
||||||
color: Colors.transparent,
|
|
||||||
borderRadius: BorderRadius.circular(28),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: statusProvider.protectionsManagementProcess.contains('general') == false
|
|
||||||
? () => updateBlocking(
|
|
||||||
value: !statusProvider.serverStatus!.generalEnabled,
|
|
||||||
filter: 'general_legacy'
|
|
||||||
) : null,
|
|
||||||
borderRadius: BorderRadius.circular(28),
|
|
||||||
child: Container(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 20,
|
|
||||||
vertical: 12
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(28),
|
|
||||||
color: Theme.of(context).primaryColor.withOpacity(0.1)
|
|
||||||
),
|
|
||||||
child: _TopRow(
|
|
||||||
legacyMode: true,
|
|
||||||
expandableController: expandableController,
|
|
||||||
updateBlocking: updateBlocking,
|
|
||||||
animation: animation,
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,11 +181,6 @@ class _AddDnsRewriteModalState extends State<DnsRewriteModal> {
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: validData == true
|
onPressed: validData == true
|
||||||
? () {
|
? () {
|
||||||
if (serverVersionIsAhead(
|
|
||||||
currentVersion: statusProvider.serverStatus!.serverVersion,
|
|
||||||
referenceVersion: '0.107.33',
|
|
||||||
referenceVersionBeta: '0.108.0-b.39'
|
|
||||||
)) {
|
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
widget.onConfirm(
|
widget.onConfirm(
|
||||||
RewriteRules(
|
RewriteRules(
|
||||||
|
@ -195,13 +190,6 @@ class _AddDnsRewriteModalState extends State<DnsRewriteModal> {
|
||||||
widget.rule
|
widget.rule
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => const ServerVersionNeeded(version: 'v0.107.33')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
: null,
|
: null,
|
||||||
child: Text(
|
child: Text(
|
||||||
AppLocalizations.of(context)!.confirm,
|
AppLocalizations.of(context)!.confirm,
|
||||||
|
|
|
@ -170,11 +170,7 @@ class _SettingsWidgetState extends State<SettingsWidget> {
|
||||||
serversProvider.apiClient != null
|
serversProvider.apiClient != null
|
||||||
) ...[
|
) ...[
|
||||||
SectionLabel(label: AppLocalizations.of(context)!.serverSettings),
|
SectionLabel(label: AppLocalizations.of(context)!.serverSettings),
|
||||||
if (serverVersionIsAhead(
|
settingsTile(
|
||||||
currentVersion: statusProvider.serverStatus!.serverVersion,
|
|
||||||
referenceVersion: 'v0.107.28',
|
|
||||||
referenceVersionBeta: 'v0.108.0-b.33'
|
|
||||||
) == true) settingsTile(
|
|
||||||
icon: Icons.search_rounded,
|
icon: Icons.search_rounded,
|
||||||
title: AppLocalizations.of(context)!.safeSearch,
|
title: AppLocalizations.of(context)!.safeSearch,
|
||||||
subtitle: AppLocalizations.of(context)!.safeSearchSettings,
|
subtitle: AppLocalizations.of(context)!.safeSearchSettings,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue