mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-14 14:02:48 +00:00
Fixed small issue general protection toggle
This commit is contained in:
parent
bfa4130acf
commit
661396d5f9
1 changed files with 12 additions and 12 deletions
|
@ -147,13 +147,13 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget mainSwitch() {
|
Widget mainSwitch() {
|
||||||
Widget topRow(bool legacyMode) {
|
Widget topRow({required bool legacyMode}) {
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
if (legacyMode == true) ...[
|
if (legacyMode == false) ...[
|
||||||
RotationTransition(
|
RotationTransition(
|
||||||
turns: animation,
|
turns: animation,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
|
@ -189,7 +189,7 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
|
||||||
value: serversProvider.serverStatus.data!.generalEnabled,
|
value: serversProvider.serverStatus.data!.generalEnabled,
|
||||||
onChanged: serversProvider.protectionsManagementProcess.contains('general') == false
|
onChanged: serversProvider.protectionsManagementProcess.contains('general') == false
|
||||||
? (value) {
|
? (value) {
|
||||||
if (value == false) {
|
if (value == false && expandableController.expanded == true && legacyMode == false) {
|
||||||
expandableController.toggle();
|
expandableController.toggle();
|
||||||
}
|
}
|
||||||
updateBlocking(
|
updateBlocking(
|
||||||
|
@ -211,35 +211,35 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
|
||||||
children: [
|
children: [
|
||||||
ActionChip(
|
ActionChip(
|
||||||
label: Text(AppLocalizations.of(context)!.seconds(30)),
|
label: Text(AppLocalizations.of(context)!.seconds(30)),
|
||||||
onPressed: serversProvider.protectionsManagementProcess.contains('general') == false
|
onPressed: serversProvider.protectionsManagementProcess.contains('general') == false && serversProvider.serverStatus.data!.generalEnabled == true
|
||||||
? () => disableWithCountdown(29000)
|
? () => disableWithCountdown(29000)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
ActionChip(
|
ActionChip(
|
||||||
label: Text(AppLocalizations.of(context)!.minute(1)),
|
label: Text(AppLocalizations.of(context)!.minute(1)),
|
||||||
onPressed: serversProvider.protectionsManagementProcess.contains('general') == false
|
onPressed: serversProvider.protectionsManagementProcess.contains('general') == false && serversProvider.serverStatus.data!.generalEnabled == true
|
||||||
? () => disableWithCountdown(59000)
|
? () => disableWithCountdown(59000)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
ActionChip(
|
ActionChip(
|
||||||
label: Text(AppLocalizations.of(context)!.minutes(10)),
|
label: Text(AppLocalizations.of(context)!.minutes(10)),
|
||||||
onPressed: serversProvider.protectionsManagementProcess.contains('general') == false
|
onPressed: serversProvider.protectionsManagementProcess.contains('general') == false && serversProvider.serverStatus.data!.generalEnabled == true
|
||||||
? () => disableWithCountdown(599000)
|
? () => disableWithCountdown(599000)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
ActionChip(
|
ActionChip(
|
||||||
label: Text(AppLocalizations.of(context)!.hour(1)),
|
label: Text(AppLocalizations.of(context)!.hour(1)),
|
||||||
onPressed: serversProvider.protectionsManagementProcess.contains('general') == false
|
onPressed: serversProvider.protectionsManagementProcess.contains('general') == false && serversProvider.serverStatus.data!.generalEnabled == true
|
||||||
? () => disableWithCountdown(3599000)
|
? () => disableWithCountdown(3599000)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
ActionChip(
|
ActionChip(
|
||||||
label: Text(AppLocalizations.of(context)!.hours(24)),
|
label: Text(AppLocalizations.of(context)!.hours(24)),
|
||||||
onPressed: serversProvider.protectionsManagementProcess.contains('general') == false
|
onPressed: serversProvider.protectionsManagementProcess.contains('general') == false && serversProvider.serverStatus.data!.generalEnabled == true
|
||||||
? () => disableWithCountdown(86399000)
|
? () => disableWithCountdown(86399000)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
|
@ -261,7 +261,7 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
borderRadius: BorderRadius.circular(28),
|
borderRadius: BorderRadius.circular(28),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: serversProvider.serverStatus.data!.generalEnabled == true
|
onTap: serversProvider.serverStatus.data!.generalEnabled == true && !serversProvider.protectionsManagementProcess.contains('general')
|
||||||
? () => expandableController.toggle()
|
? () => expandableController.toggle()
|
||||||
: null,
|
: null,
|
||||||
borderRadius: BorderRadius.circular(28),
|
borderRadius: BorderRadius.circular(28),
|
||||||
|
@ -279,10 +279,10 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
|
||||||
animationDuration: Duration(milliseconds: 200),
|
animationDuration: Duration(milliseconds: 200),
|
||||||
fadeCurve: Curves.ease
|
fadeCurve: Curves.ease
|
||||||
),
|
),
|
||||||
collapsed: topRow(true),
|
collapsed: topRow(legacyMode: false),
|
||||||
expanded: Column(
|
expanded: Column(
|
||||||
children: [
|
children: [
|
||||||
topRow(true),
|
topRow(legacyMode: false),
|
||||||
bottomRow(),
|
bottomRow(),
|
||||||
const SizedBox(height: 8)
|
const SizedBox(height: 8)
|
||||||
],
|
],
|
||||||
|
@ -311,7 +311,7 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
|
||||||
borderRadius: BorderRadius.circular(28),
|
borderRadius: BorderRadius.circular(28),
|
||||||
color: Theme.of(context).primaryColor.withOpacity(0.1)
|
color: Theme.of(context).primaryColor.withOpacity(0.1)
|
||||||
),
|
),
|
||||||
child: topRow(false)
|
child: topRow(legacyMode: true)
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue