Fixed issue bottomsheets low height situations and changed color custom list tiles

This commit is contained in:
Juan Gilsanz Polo 2022-10-21 11:26:14 +02:00
parent 3552bbced6
commit 6f9b16e94f
21 changed files with 655 additions and 632 deletions

View file

@ -233,12 +233,12 @@ class _ClientModalState extends State<ClientModal> {
onChanged: onChange,
activeColor: Theme.of(context).primaryColor,
)
: const Padding(
padding: EdgeInsets.symmetric(vertical: 14),
: Padding(
padding: const EdgeInsets.symmetric(vertical: 14),
child: Text(
"Global",
style: TextStyle(
color: Colors.grey
color: Theme.of(context).listTileTheme.iconColor,
),
),
)
@ -307,9 +307,9 @@ class _ClientModalState extends State<ClientModal> {
),
child: Row(
children: [
const Icon(
Icon(
Icons.label_rounded,
color: Colors.grey,
color: Theme.of(context).listTileTheme.iconColor,
),
const SizedBox(width: 20),
Column(
@ -326,8 +326,8 @@ class _ClientModalState extends State<ClientModal> {
selectedTags.isNotEmpty
? "${selectedTags.length} ${AppLocalizations.of(context)!.tagsSelected}"
: AppLocalizations.of(context)!.noTagsSelected,
style: const TextStyle(
color: Colors.grey
style: TextStyle(
color: Theme.of(context).listTileTheme.iconColor,
),
)
],
@ -527,9 +527,11 @@ class _ClientModalState extends State<ClientModal> {
),
child: Row(
children: [
const Icon(
Icon(
Icons.public,
color: Colors.grey,
color: useGlobalSettingsServices == false
? Theme.of(context).listTileTheme.iconColor
: Colors.grey,
),
const SizedBox(width: 20),
Column(
@ -541,7 +543,7 @@ class _ClientModalState extends State<ClientModal> {
fontSize: 16,
color: useGlobalSettingsServices == false
? null
: Colors.grey
: Theme.of(context).listTileTheme.iconColor,
),
),
if (useGlobalSettingsServices == false) ...[
@ -550,8 +552,8 @@ class _ClientModalState extends State<ClientModal> {
blockedServices.isNotEmpty
? "${blockedServices.length} ${AppLocalizations.of(context)!.servicesBlocked}"
: AppLocalizations.of(context)!.noBlockedServicesSelected,
style: const TextStyle(
color: Colors.grey
style: TextStyle(
color: Theme.of(context).listTileTheme.iconColor,
),
)
]

View file

@ -69,8 +69,7 @@ class _AddListModalState extends State<AddListModal> {
return Padding(
padding: MediaQuery.of(context).viewInsets,
child: Container(
height: 408,
padding: const EdgeInsets.all(24),
height: 410,
decoration: BoxDecoration(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(28),
@ -80,100 +79,114 @@ class _AddListModalState extends State<AddListModal> {
),
child: Column(
children: [
Icon(
widget.type == 'whitelist'
? Icons.verified_user_rounded
: Icons.gpp_bad_rounded,
size: 26,
),
const SizedBox(height: 20),
Text(
widget.list != null
? widget.type == 'whitelist'
? AppLocalizations.of(context)!.editWhitelist
: AppLocalizations.of(context)!.editBlacklist
: widget.type == 'whitelist'
? AppLocalizations.of(context)!.addWhitelist
: AppLocalizations.of(context)!.addBlacklist,
style: const TextStyle(
fontSize: 24
),
),
const SizedBox(height: 30),
TextFormField(
controller: nameController,
onChanged: (_) => checkValidValues(),
decoration: InputDecoration(
prefixIcon: const Icon(Icons.badge_rounded),
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10)
)
),
labelText: AppLocalizations.of(context)!.name,
),
),
const SizedBox(height: 30),
TextFormField(
controller: urlController,
onChanged: validateUrl,
enabled: widget.list != null ? false : true,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.link_rounded),
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10)
)
),
errorText: urlError,
labelText: AppLocalizations.of(context)!.urlAbsolutePath,
),
),
const SizedBox(height: 20),
Expanded(
child: Column(
child: ListView(
physics: 410 < MediaQuery.of(context).size.height
? const NeverScrollableScrollPhysics()
: null,
children: [
Padding(
padding: const EdgeInsets.only(top: 28),
child: Icon(
widget.type == 'whitelist'
? Icons.verified_user_rounded
: Icons.gpp_bad_rounded,
size: 26,
),
),
const SizedBox(height: 20),
Text(
widget.list != null
? widget.type == 'whitelist'
? AppLocalizations.of(context)!.editWhitelist
: AppLocalizations.of(context)!.editBlacklist
: widget.type == 'whitelist'
? AppLocalizations.of(context)!.addWhitelist
: AppLocalizations.of(context)!.addBlacklist,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 24
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 28),
child: TextFormField(
controller: nameController,
onChanged: (_) => checkValidValues(),
decoration: InputDecoration(
prefixIcon: const Icon(Icons.badge_rounded),
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10)
)
),
labelText: AppLocalizations.of(context)!.name,
),
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 28),
child: TextFormField(
controller: urlController,
onChanged: validateUrl,
enabled: widget.list != null ? false : true,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.link_rounded),
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10)
)
),
errorText: urlError,
labelText: AppLocalizations.of(context)!.urlAbsolutePath,
),
),
),
],
),
),
Padding(
padding: const EdgeInsets.all(20),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(AppLocalizations.of(context)!.cancel)
),
const SizedBox(width: 20),
TextButton(
onPressed: () {
Navigator.pop(context);
if (widget.list != null) {
final Filter newList = Filter(
url: urlController.text,
name: nameController.text,
lastUpdated: widget.list!.lastUpdated,
id: widget.list!.id,
rulesCount: widget.list!.rulesCount,
enabled: widget.list!.enabled
);
widget.onEdit!(
list: newList,
type: widget.type
);
}
else {
widget.onConfirm!(
name: nameController.text,
url: urlController.text,
type: widget.type
);
}
},
child: Text(
widget.list != null
? AppLocalizations.of(context)!.save
: AppLocalizations.of(context)!.confirm
)
),
],
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(AppLocalizations.of(context)!.cancel)
),
const SizedBox(width: 20),
TextButton(
onPressed: () {
Navigator.pop(context);
if (widget.list != null) {
final Filter newList = Filter(
url: urlController.text,
name: nameController.text,
lastUpdated: widget.list!.lastUpdated,
id: widget.list!.id,
rulesCount: widget.list!.rulesCount,
enabled: widget.list!.enabled
);
widget.onEdit!(
list: newList,
type: widget.type
);
}
else {
widget.onConfirm!(
name: nameController.text,
url: urlController.text,
type: widget.type
);
}
},
child: Text(
widget.list != null
? AppLocalizations.of(context)!.save
: AppLocalizations.of(context)!.confirm
)
),
],
),

View file

@ -122,64 +122,74 @@ class _CheckHostModalState extends State<CheckHostModal> {
child: Center(
child: Column(
children: [
const Padding(
padding: EdgeInsets.only(top: 24),
child: Icon(
Icons.shield_rounded,
size: 26,
),
),
const SizedBox(height: 20),
Text(
AppLocalizations.of(context)!.checkHostFiltered,
style: const TextStyle(
fontSize: 24
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: TextFormField(
controller: domainController,
onChanged: validateDomain,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.link_rounded),
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10)
)
),
errorText: domainError,
labelText: AppLocalizations.of(context)!.domain,
),
),
),
if (resultWidget != null) Expanded(
child: Padding(
padding: const EdgeInsets.only(
top: 20,
left: 20,
right: 20
),
child: resultWidget,
),
),
if (resultWidget == null) Expanded(
child: Padding(
padding: const EdgeInsets.only(
top: 20,
left: 20,
right: 20
),
child: Center(
child: Text(
AppLocalizations.of(context)!.insertDomain,
style: const TextStyle(
fontSize: 16,
Expanded(
child: ListView(
physics: 350 < MediaQuery.of(context).size.height
? const NeverScrollableScrollPhysics()
: null,
children: [
const Padding(
padding: EdgeInsets.only(top: 24),
child: Icon(
Icons.shield_rounded,
size: 26,
),
),
),
)
const SizedBox(height: 20),
Text(
AppLocalizations.of(context)!.checkHostFiltered,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 24
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: TextFormField(
controller: domainController,
onChanged: validateDomain,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.link_rounded),
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10)
)
),
errorText: domainError,
labelText: AppLocalizations.of(context)!.domain,
),
),
),
if (resultWidget != null) Expanded(
child: Padding(
padding: const EdgeInsets.only(
top: 20,
left: 20,
right: 20
),
child: resultWidget,
),
),
if (resultWidget == null) Expanded(
child: Padding(
padding: const EdgeInsets.only(
top: 20,
left: 20,
right: 20
),
child: Center(
child: Text(
AppLocalizations.of(context)!.insertDomain,
style: const TextStyle(
fontSize: 16,
),
),
),
)
),
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.end,

View file

@ -26,7 +26,7 @@ class FilterListTile extends StatelessWidget {
Icon(
icon,
size: 26,
color: Colors.grey,
color: Theme.of(context).listTileTheme.iconColor,
),
const SizedBox(width: 20),
Column(
@ -46,7 +46,7 @@ class FilterListTile extends StatelessWidget {
subtitle,
style: TextStyle(
fontSize: 14,
color: color ?? Colors.grey,
color: color ?? Theme.of(context).listTileTheme.iconColor,
fontWeight: bold == true ? FontWeight.bold : null
),
),

View file

@ -213,14 +213,19 @@ class _FiltersListState extends State<FiltersList> {
}
void openDetailsModal(Filter filter) {
final height = (filter.enabled == true ? 774 : 755)/MediaQuery.of(context).size.height < 1
? (filter.enabled == true ? 774 : 755)/MediaQuery.of(context).size.height
: 0.95;
ScaffoldMessenger.of(context).clearSnackBars();
print(height);
showFlexibleBottomSheet(
minHeight: 0.6,
initHeight: 0.6,
maxHeight: (filter.enabled == true ? 774 : 755)/MediaQuery.of(context).size.height,
maxHeight: height,
isCollapsible: true,
duration: const Duration(milliseconds: 250),
anchors: [(filter.enabled == true ? 774 : 755)/MediaQuery.of(context).size.height],
anchors: [height],
context: context,
builder: (ctx, controller, offset) => ListDetailsModal(
scrollController: controller,
@ -308,9 +313,9 @@ class _FiltersListState extends State<FiltersList> {
const SizedBox(height: 5),
Text(
"${intFormat(widget.data[index].rulesCount, Platform.localeName)} ${AppLocalizations.of(context)!.enabledRules}",
style: const TextStyle(
style: TextStyle(
fontSize: 14,
color: Colors.grey
color: Theme.of(context).listTileTheme.iconColor,
),
),
],

View file

@ -42,9 +42,7 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
return Padding(
padding: mediaQueryData.viewInsets,
child: Container(
height: mediaQueryData.size.height > (Platform.isIOS ? 296 : 410)
? (Platform.isIOS ? 396 : 410)
: mediaQueryData.size.height-25,
height: 410,
decoration: BoxDecoration(
color: Theme.of(context).dialogBackgroundColor,
borderRadius: const BorderRadius.only(
@ -52,249 +50,251 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
topRight: Radius.circular(28)
),
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Padding(
padding: EdgeInsets.only(top: 24),
child: Icon(
Icons.update_rounded,
size: 26,
),
),
Container(
padding: const EdgeInsets.all(24),
width: double.maxFinite,
child: Text(
AppLocalizations.of(context)!.updateFrequency,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 24,
),
),
),
SizedBox(
width: double.maxFinite,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
width: (mediaQueryData.size.width-70)/2,
margin: const EdgeInsets.only(
top: 10,
right: 5,
bottom: 5
),
child: OptionBox(
optionsValue: selectedOption,
itemValue: 0,
onTap: _updateRadioValue,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 0
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.never),
),
),
),
),
Container(
width: (mediaQueryData.size.width-70)/2,
margin: const EdgeInsets.only(
top: 10,
left: 5,
bottom: 5
),
child: OptionBox(
optionsValue: selectedOption,
itemValue: 1,
onTap: _updateRadioValue,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 1
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.hour1),
),
),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
width: (mediaQueryData.size.width-70)/2,
margin: const EdgeInsets.only(
top: 5,
right: 5,
bottom: 5
),
child: OptionBox(
optionsValue: selectedOption,
itemValue: 12,
onTap: _updateRadioValue,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 12
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.hours12),
),
),
),
),
Container(
width: (mediaQueryData.size.width-70)/2,
margin: const EdgeInsets.only(
top: 5,
left: 5,
bottom: 5
),
child: OptionBox(
optionsValue: selectedOption,
itemValue: 24,
onTap: _updateRadioValue,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 24
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.hours24),
),
),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
width: (mediaQueryData.size.width-70)/2,
margin: const EdgeInsets.only(
top: 5,
right: 5,
bottom: 10
),
child: OptionBox(
optionsValue: selectedOption,
itemValue: 72,
onTap: _updateRadioValue,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 72
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.days3),
),
),
),
),
Container(
width: (mediaQueryData.size.width-70)/2,
margin: const EdgeInsets.only(
top: 5,
left: 5,
bottom: 10
),
child: OptionBox(
optionsValue: selectedOption,
itemValue: 168,
onTap: _updateRadioValue,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 168
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.days7),
),
),
),
),
],
),
],
),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.end,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: ListView(
physics: 410 < MediaQuery.of(context).size.height
? const NeverScrollableScrollPhysics()
: null,
children: [
Padding(
padding: const EdgeInsets.all(20),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
const Padding(
padding: EdgeInsets.only(top: 24),
child: Icon(
Icons.update_rounded,
size: 26,
),
),
Container(
padding: const EdgeInsets.all(24),
width: double.maxFinite,
child: Text(
AppLocalizations.of(context)!.updateFrequency,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 24,
),
),
),
SizedBox(
width: double.maxFinite,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
children: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(AppLocalizations.of(context)!.cancel),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
width: (mediaQueryData.size.width-70)/2,
margin: const EdgeInsets.only(
top: 10,
right: 5,
bottom: 5
),
child: OptionBox(
optionsValue: selectedOption,
itemValue: 0,
onTap: _updateRadioValue,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 0
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.never),
),
),
),
),
Container(
width: (mediaQueryData.size.width-70)/2,
margin: const EdgeInsets.only(
top: 10,
left: 5,
bottom: 5
),
child: OptionBox(
optionsValue: selectedOption,
itemValue: 1,
onTap: _updateRadioValue,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 1
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.hour1),
),
),
),
),
],
),
const SizedBox(width: 20),
TextButton(
onPressed: selectedOption != null
? () {
Navigator.pop(context);
widget.onChange(selectedOption!);
}
: null,
style: ButtonStyle(
overlayColor: MaterialStateProperty.all(
Theme.of(context).primaryColor.withOpacity(0.1)
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
width: (mediaQueryData.size.width-70)/2,
margin: const EdgeInsets.only(
top: 5,
right: 5,
bottom: 5
),
child: OptionBox(
optionsValue: selectedOption,
itemValue: 12,
onTap: _updateRadioValue,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 12
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.hours12),
),
),
),
),
foregroundColor: MaterialStateProperty.all(
selectedOption != null
? Theme.of(context).primaryColor
: Colors.grey,
Container(
width: (mediaQueryData.size.width-70)/2,
margin: const EdgeInsets.only(
top: 5,
left: 5,
bottom: 5
),
child: OptionBox(
optionsValue: selectedOption,
itemValue: 24,
onTap: _updateRadioValue,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 24
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.hours24),
),
),
),
),
),
child: Text(AppLocalizations.of(context)!.confirm),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
width: (mediaQueryData.size.width-70)/2,
margin: const EdgeInsets.only(
top: 5,
right: 5,
bottom: 10
),
child: OptionBox(
optionsValue: selectedOption,
itemValue: 72,
onTap: _updateRadioValue,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 72
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.days3),
),
),
),
),
Container(
width: (mediaQueryData.size.width-70)/2,
margin: const EdgeInsets.only(
top: 5,
left: 5,
bottom: 10
),
child: OptionBox(
optionsValue: selectedOption,
itemValue: 168,
onTap: _updateRadioValue,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 168
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.days7),
),
),
),
),
],
),
],
),
),
),
],
)
],
),
),
),
Padding(
padding: const EdgeInsets.all(20),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(AppLocalizations.of(context)!.cancel),
),
const SizedBox(width: 20),
TextButton(
onPressed: selectedOption != null
? () {
Navigator.pop(context);
widget.onChange(selectedOption!);
}
: null,
style: ButtonStyle(
overlayColor: MaterialStateProperty.all(
Theme.of(context).primaryColor.withOpacity(0.1)
),
foregroundColor: MaterialStateProperty.all(
selectedOption != null
? Theme.of(context).primaryColor
: Colors.grey,
),
),
child: Text(AppLocalizations.of(context)!.confirm),
),
],
),
)
],
),
),
);

View file

@ -57,7 +57,7 @@ class _FilterStatusModalState extends State<FilterStatusModal> {
Icon(
icon,
size: 24,
color: Colors.grey,
color: Theme.of(context).listTileTheme.iconColor,
),
const SizedBox(width: 20),
Text(

View file

@ -82,7 +82,7 @@ class LogDetailsModal extends StatelessWidget {
? Container(
padding: const EdgeInsets.all(5),
decoration: BoxDecoration(
color: Colors.grey,
color: Theme.of(context).listTileTheme.iconColor,
borderRadius: BorderRadius.circular(10)
),
child: const Text(

View file

@ -30,7 +30,7 @@ class LogListTile extends StatelessWidget {
Icon(
icon,
size: 24,
color: Colors.grey,
color: Theme.of(context).listTileTheme.iconColor,
),
const SizedBox(width: 20),
Column(
@ -49,9 +49,9 @@ class LogListTile extends StatelessWidget {
child: Text(
subtitle!,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
style: TextStyle(
fontSize: 14,
color: Colors.grey
color: Theme.of(context).listTileTheme.iconColor,
),
),
)

View file

@ -183,8 +183,8 @@ class LogTile extends StatelessWidget {
child: Text(
log.client,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
color: Colors.grey,
style: TextStyle(
color: Theme.of(context).listTileTheme.iconColor,
fontSize: 13
),
),

View file

@ -286,10 +286,10 @@ class _LogsFiltersModalWidgetState extends State<LogsFiltersModalWidget> {
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child: Row(
children: [
const Icon(
Icon(
Icons.shield_rounded,
size: 24,
color: Colors.grey,
color: Theme.of(context).listTileTheme.iconColor,
),
const SizedBox(width: 20),
Column(
@ -305,9 +305,9 @@ class _LogsFiltersModalWidgetState extends State<LogsFiltersModalWidget> {
const SizedBox(height: 5),
Text(
"${translatedString[logsProvider.selectedResultStatus]}",
style: const TextStyle(
style: TextStyle(
fontSize: 14,
color: Colors.grey
color: Theme.of(context).listTileTheme.iconColor,
),
)
],

View file

@ -77,67 +77,70 @@ class _AddClientModalState extends State<AddClientModal> {
),
child: Column(
children: [
Icon(
icon(),
size: 26,
),
const SizedBox(height: 20),
Text(
title(),
style: const TextStyle(
fontSize: 24
),
),
const SizedBox(height: 30),
TextFormField(
controller: fieldController,
onChanged: (_) => checkValidValues(),
decoration: InputDecoration(
prefixIcon: const Icon(Icons.link_rounded),
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10)
)
),
helperText: widget.type == 'allowed' || widget.type == 'disallowed'
? AppLocalizations.of(context)!.addClientFieldDescription : null,
labelText: widget.type == 'allowed' || widget.type == 'disallowed'
? AppLocalizations.of(context)!.clientIdentifier
: AppLocalizations.of(context)!.domain,
),
),
Expanded(
child: Column(
child: ListView(
physics: 322 < MediaQuery.of(context).size.height
? const NeverScrollableScrollPhysics()
: null,
children: [
Icon(
icon(),
size: 26,
),
const SizedBox(height: 20),
Text(
title(),
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 24
),
),
const SizedBox(height: 30),
TextFormField(
controller: fieldController,
onChanged: (_) => checkValidValues(),
decoration: InputDecoration(
prefixIcon: const Icon(Icons.link_rounded),
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10)
)
),
helperText: widget.type == 'allowed' || widget.type == 'disallowed'
? AppLocalizations.of(context)!.addClientFieldDescription : null,
labelText: widget.type == 'allowed' || widget.type == 'disallowed'
? AppLocalizations.of(context)!.clientIdentifier
: AppLocalizations.of(context)!.domain,
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(top: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.only(top: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(AppLocalizations.of(context)!.cancel)
),
const SizedBox(width: 20),
TextButton(
onPressed: validData == true
? () {
Navigator.pop(context);
widget.onConfirm(fieldController.text, widget.type);
}
: null,
child: Text(
AppLocalizations.of(context)!.confirm,
style: TextStyle(
color: validData == true
? Theme.of(context).primaryColor
: Colors.grey
),
)
),
],
),
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(AppLocalizations.of(context)!.cancel)
),
const SizedBox(width: 20),
TextButton(
onPressed: validData == true
? () {
Navigator.pop(context);
widget.onConfirm(fieldController.text, widget.type);
}
: null,
child: Text(
AppLocalizations.of(context)!.confirm,
style: TextStyle(
color: validData == true
? Theme.of(context).primaryColor
: Colors.grey
),
)
),
],
),

View file

@ -68,9 +68,7 @@ class _AddStaticLeaseModalState extends State<AddStaticLeaseModal> {
return Padding(
padding: MediaQuery.of(context).viewInsets,
child: Container(
height: MediaQuery.of(context).viewInsets.bottom > 0
? MediaQuery.of(context).size.height-MediaQuery.of(context).viewInsets.bottom-25
: 550,
height: 550,
decoration: BoxDecoration(
color: Theme.of(context).dialogBackgroundColor,
borderRadius: const BorderRadius.only(
@ -80,13 +78,11 @@ class _AddStaticLeaseModalState extends State<AddStaticLeaseModal> {
),
child: Column(
children: [
SizedBox(
height: MediaQuery.of(context).viewInsets.bottom > 0
? MediaQuery.of(context).size.height-425
: MediaQuery.of(context).size.height-400,
Expanded(
child: ListView(
shrinkWrap: true,
primary: false,
physics: 550 < MediaQuery.of(context).size.height
? const NeverScrollableScrollPhysics()
: null,
children: [
const Padding(
padding: EdgeInsets.only(top: 28),
@ -168,45 +164,38 @@ class _AddStaticLeaseModalState extends State<AddStaticLeaseModal> {
],
),
),
Expanded(
child: Column(
Padding(
padding: const EdgeInsets.all(20),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.all(20),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(AppLocalizations.of(context)!.cancel),
),
const SizedBox(width: 20),
TextButton(
onPressed: validData == true
? () {
Navigator.pop(context);
widget.onConfirm(
Lease(
mac: macController.text,
hostname: hostNameController.text,
ip: ipController.text
)
);
}
: null,
child: Text(
AppLocalizations.of(context)!.confirm,
style: TextStyle(
color: validData == true
? Theme.of(context).primaryColor
: Colors.grey
),
),
),
],
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(AppLocalizations.of(context)!.cancel),
),
const SizedBox(width: 20),
TextButton(
onPressed: validData == true
? () {
Navigator.pop(context);
widget.onConfirm(
Lease(
mac: macController.text,
hostname: hostNameController.text,
ip: ipController.text
)
);
}
: null,
child: Text(
AppLocalizations.of(context)!.confirm,
style: TextStyle(
color: validData == true
? Theme.of(context).primaryColor
: Colors.grey
),
),
)
),
],
),
)

View file

@ -406,9 +406,9 @@ class _DhcpWidgetState extends State<DhcpWidget> {
if (selectedInterface != null) ...[
Text(
selectedInterface!.name,
style: const TextStyle(
style: TextStyle(
fontSize: 14,
color: Colors.grey
color: Theme.of(context).listTileTheme.iconColor,
),
)
]

View file

@ -61,98 +61,100 @@ class _AddDnsRewriteModalState extends State<AddDnsRewriteModal> {
),
child: Column(
children: [
const Padding(
padding: EdgeInsets.only(top: 28),
child: Icon(
Icons.add,
size: 26,
),
),
const SizedBox(height: 20),
Text(
AppLocalizations.of(context)!.addDnsRewrite,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 24
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 28),
child: TextFormField(
controller: domainController,
onChanged: validateDomain,
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(
padding: const EdgeInsets.symmetric(horizontal: 28),
child: TextFormField(
controller: answerController,
onChanged: (_) => checkValidValues(),
decoration: InputDecoration(
prefixIcon: const Icon(Icons.system_update_alt_rounded),
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10)
)
),
labelText: AppLocalizations.of(context)!.answer,
),
),
),
Expanded(
child: Column(
child: ListView(
physics: 410 < MediaQuery.of(context).size.height
? const NeverScrollableScrollPhysics()
: null,
children: [
const Padding(
padding: EdgeInsets.only(top: 28),
child: Icon(
Icons.add,
size: 26,
),
),
const SizedBox(height: 20),
Text(
AppLocalizations.of(context)!.addDnsRewrite,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 24
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 28),
child: TextFormField(
controller: domainController,
onChanged: validateDomain,
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(
padding: const EdgeInsets.symmetric(horizontal: 28),
child: TextFormField(
controller: answerController,
onChanged: (_) => checkValidValues(),
decoration: InputDecoration(
prefixIcon: const Icon(Icons.system_update_alt_rounded),
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10)
)
),
labelText: AppLocalizations.of(context)!.answer,
),
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(
top: 20,
bottom: 20,
right: 28
),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.only(
top: 20,
bottom: 20,
right: 28
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(AppLocalizations.of(context)!.cancel),
),
const SizedBox(width: 20),
TextButton(
onPressed: validData == true
? () {
Navigator.pop(context);
widget.onConfirm(
RewriteRulesData(
domain: domainController.text,
answer: answerController.text
)
);
}
: null,
child: Text(
AppLocalizations.of(context)!.confirm,
style: TextStyle(
color: validData == true
? Theme.of(context).primaryColor
: Colors.grey
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(AppLocalizations.of(context)!.cancel),
),
const SizedBox(width: 20),
TextButton(
onPressed: validData == true
? () {
Navigator.pop(context);
widget.onConfirm(
RewriteRulesData(
domain: domainController.text,
answer: answerController.text
)
);
}
: null,
child: Text(
AppLocalizations.of(context)!.confirm,
style: TextStyle(
color: validData == true
? Theme.of(context).primaryColor
: Colors.grey
),
),
),
],
),
)
),
],
),
)

View file

@ -36,12 +36,8 @@ class _ThemeModalState extends State<ThemeModal> {
Widget build(BuildContext context) {
final appConfigProvider = Provider.of<AppConfigProvider>(context);
final mediaQuery = MediaQuery.of(context);
return Container(
height: mediaQuery.orientation == Orientation.landscape
? mediaQuery.size.height - (widget.statusBarHeight)
: Platform.isIOS ? 408 : 388,
height: 395,
decoration: BoxDecoration(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(30),
@ -51,12 +47,14 @@ class _ThemeModalState extends State<ThemeModal> {
),
child: Column(
children: [
SizedBox(
height: 300,
child: Column(
Expanded(
child: ListView(
physics: 395 < MediaQuery.of(context).size.height
? const NeverScrollableScrollPhysics()
: null,
children: [
const Padding(
padding: EdgeInsets.only(top: 24),
padding: EdgeInsets.only(top: 28),
child: Icon(
Icons.light_mode_rounded,
size: 26,