mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-28 17:48:10 +00:00
Updated optionbox styles
This commit is contained in:
parent
95aec4b3a5
commit
bb5cdc13d1
2 changed files with 26 additions and 88 deletions
|
@ -94,19 +94,7 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
|
||||||
optionsValue: selectedOption,
|
optionsValue: selectedOption,
|
||||||
itemValue: 0,
|
itemValue: 0,
|
||||||
onTap: _updateRadioValue,
|
onTap: _updateRadioValue,
|
||||||
child: Center(
|
label: AppLocalizations.of(context)!.never,
|
||||||
child: AnimatedDefaultTextStyle(
|
|
||||||
duration: const Duration(milliseconds: 250),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14,
|
|
||||||
color: selectedOption == 0
|
|
||||||
? Theme.of(context).colorScheme.onInverseSurface
|
|
||||||
: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
child: Text(AppLocalizations.of(context)!.never),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -118,19 +106,7 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
|
||||||
optionsValue: selectedOption,
|
optionsValue: selectedOption,
|
||||||
itemValue: 1,
|
itemValue: 1,
|
||||||
onTap: _updateRadioValue,
|
onTap: _updateRadioValue,
|
||||||
child: Center(
|
label: AppLocalizations.of(context)!.hour1,
|
||||||
child: AnimatedDefaultTextStyle(
|
|
||||||
duration: const Duration(milliseconds: 250),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14,
|
|
||||||
color: selectedOption == 1
|
|
||||||
? Theme.of(context).colorScheme.onInverseSurface
|
|
||||||
: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
child: Text(AppLocalizations.of(context)!.hour1),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -142,19 +118,7 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
|
||||||
optionsValue: selectedOption,
|
optionsValue: selectedOption,
|
||||||
itemValue: 12,
|
itemValue: 12,
|
||||||
onTap: _updateRadioValue,
|
onTap: _updateRadioValue,
|
||||||
child: Center(
|
label: AppLocalizations.of(context)!.hours12,
|
||||||
child: AnimatedDefaultTextStyle(
|
|
||||||
duration: const Duration(milliseconds: 250),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14,
|
|
||||||
color: selectedOption == 12
|
|
||||||
? Theme.of(context).colorScheme.onInverseSurface
|
|
||||||
: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
child: Text(AppLocalizations.of(context)!.hours12),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -166,19 +130,8 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
|
||||||
optionsValue: selectedOption,
|
optionsValue: selectedOption,
|
||||||
itemValue: 24,
|
itemValue: 24,
|
||||||
onTap: _updateRadioValue,
|
onTap: _updateRadioValue,
|
||||||
child: Center(
|
label: AppLocalizations.of(context)!.hours24,
|
||||||
child: AnimatedDefaultTextStyle(
|
|
||||||
duration: const Duration(milliseconds: 250),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14,
|
|
||||||
color: selectedOption == 24
|
|
||||||
? Theme.of(context).colorScheme.onInverseSurface
|
|
||||||
: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
child: Text(AppLocalizations.of(context)!.hours24),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -190,19 +143,8 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
|
||||||
optionsValue: selectedOption,
|
optionsValue: selectedOption,
|
||||||
itemValue: 72,
|
itemValue: 72,
|
||||||
onTap: _updateRadioValue,
|
onTap: _updateRadioValue,
|
||||||
child: Center(
|
label: AppLocalizations.of(context)!.days3,
|
||||||
child: AnimatedDefaultTextStyle(
|
|
||||||
duration: const Duration(milliseconds: 250),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14,
|
|
||||||
color: selectedOption == 72
|
|
||||||
? Theme.of(context).colorScheme.onInverseSurface
|
|
||||||
: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
child: Text(AppLocalizations.of(context)!.days3),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -214,19 +156,7 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
|
||||||
optionsValue: selectedOption,
|
optionsValue: selectedOption,
|
||||||
itemValue: 168,
|
itemValue: 168,
|
||||||
onTap: _updateRadioValue,
|
onTap: _updateRadioValue,
|
||||||
child: Center(
|
label: AppLocalizations.of(context)!.days7,
|
||||||
child: AnimatedDefaultTextStyle(
|
|
||||||
duration: const Duration(milliseconds: 250),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14,
|
|
||||||
color: selectedOption == 168
|
|
||||||
? Theme.of(context).colorScheme.onInverseSurface
|
|
||||||
: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
child: Text(AppLocalizations.of(context)!.days7),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class OptionBox extends StatelessWidget {
|
class OptionBox extends StatelessWidget {
|
||||||
final Widget child;
|
|
||||||
final dynamic optionsValue;
|
final dynamic optionsValue;
|
||||||
final dynamic itemValue;
|
final dynamic itemValue;
|
||||||
final void Function(dynamic) onTap;
|
final void Function(dynamic) onTap;
|
||||||
|
final String label;
|
||||||
|
|
||||||
const OptionBox({
|
const OptionBox({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.child,
|
|
||||||
required this.optionsValue,
|
required this.optionsValue,
|
||||||
required this.itemValue,
|
required this.itemValue,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
|
required this.label,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -25,19 +25,27 @@ class OptionBox extends StatelessWidget {
|
||||||
child: AnimatedContainer(
|
child: AnimatedContainer(
|
||||||
duration: const Duration(milliseconds: 250),
|
duration: const Duration(milliseconds: 250),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
padding: const EdgeInsets.all(15),
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(50),
|
borderRadius: BorderRadius.circular(50),
|
||||||
border: Border.all(
|
|
||||||
color: optionsValue == itemValue
|
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Theme.of(context).colorScheme.onSurfaceVariant
|
|
||||||
),
|
|
||||||
color: optionsValue == itemValue
|
color: optionsValue == itemValue
|
||||||
? Theme.of(context).colorScheme.primary
|
? Theme.of(context).colorScheme.primary
|
||||||
: Colors.transparent,
|
: Theme.of(context).colorScheme.primaryContainer,
|
||||||
|
),
|
||||||
|
child: AnimatedDefaultTextStyle(
|
||||||
|
duration: const Duration(milliseconds: 250),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontSize: 14,
|
||||||
|
color: optionsValue == itemValue
|
||||||
|
? Theme.of(context).colorScheme.onInverseSurface
|
||||||
|
: Theme.of(context).colorScheme.onSurface
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
label,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: child,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue