From 26d89730ef7d852db7baf2a74e19576c30890669 Mon Sep 17 00:00:00 2001 From: Juan Gilsanz Polo Date: Fri, 21 Oct 2022 11:37:16 +0200 Subject: [PATCH] More changes --- lib/screens/clients/client_modal.dart | 5 +-- lib/screens/filters/check_host_modal.dart | 40 +++++++++---------- lib/screens/filters/filter_list_tile.dart | 33 +++++++--------- lib/screens/filters/filters_list.dart | 2 +- lib/screens/logs/filter_status_modal.dart | 1 - lib/screens/logs/log_list_tile.dart | 1 - lib/screens/logs/logs_filters_modal.dart | 48 ++++------------------- lib/widgets/custom_list_tile.dart | 1 - 8 files changed, 44 insertions(+), 87 deletions(-) diff --git a/lib/screens/clients/client_modal.dart b/lib/screens/clients/client_modal.dart index afffeda..00bef63 100644 --- a/lib/screens/clients/client_modal.dart +++ b/lib/screens/clients/client_modal.dart @@ -307,9 +307,8 @@ class _ClientModalState extends State { ), child: Row( children: [ - Icon( + const Icon( Icons.label_rounded, - color: Theme.of(context).listTileTheme.iconColor, ), const SizedBox(width: 20), Column( @@ -530,7 +529,7 @@ class _ClientModalState extends State { Icon( Icons.public, color: useGlobalSettingsServices == false - ? Theme.of(context).listTileTheme.iconColor + ? null : Colors.grey, ), const SizedBox(width: 20), diff --git a/lib/screens/filters/check_host_modal.dart b/lib/screens/filters/check_host_modal.dart index 038ecc0..88929d4 100644 --- a/lib/screens/filters/check_host_modal.dart +++ b/lib/screens/filters/check_host_modal.dart @@ -161,32 +161,28 @@ class _CheckHostModalState extends State { ), ), ), - if (resultWidget != null) Expanded( - child: Padding( - padding: const EdgeInsets.only( - top: 20, - left: 20, - right: 20 - ), - child: resultWidget, + if (resultWidget != null) 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, - ), + if (resultWidget == null) Padding( + padding: const EdgeInsets.only( + top: 20, + left: 20, + right: 20 + ), + child: Center( + child: Text( + AppLocalizations.of(context)!.insertDomain, + style: const TextStyle( + fontSize: 16, ), ), - ) + ), ), ], ), diff --git a/lib/screens/filters/filter_list_tile.dart b/lib/screens/filters/filter_list_tile.dart index 8b0d448..fc8d7d6 100644 --- a/lib/screens/filters/filter_list_tile.dart +++ b/lib/screens/filters/filter_list_tile.dart @@ -19,30 +19,27 @@ class FilterListTile extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Icon( icon, - size: 26, - color: Theme.of(context).listTileTheme.iconColor, ), const SizedBox(width: 20), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title, - style: const TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500 + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500 + ), ), - ), - const SizedBox(height: 5), - SizedBox( - width: MediaQuery.of(context).size.width-86, - child: Text( + const SizedBox(height: 5), + Text( subtitle, style: TextStyle( fontSize: 14, @@ -50,8 +47,8 @@ class FilterListTile extends StatelessWidget { fontWeight: bold == true ? FontWeight.bold : null ), ), - ), - ], + ], + ), ) ], ), diff --git a/lib/screens/filters/filters_list.dart b/lib/screens/filters/filters_list.dart index 27ccd1e..e0b74f7 100644 --- a/lib/screens/filters/filters_list.dart +++ b/lib/screens/filters/filters_list.dart @@ -218,7 +218,7 @@ class _FiltersListState extends State { : 0.95; ScaffoldMessenger.of(context).clearSnackBars(); - print(height); + showFlexibleBottomSheet( minHeight: 0.6, initHeight: 0.6, diff --git a/lib/screens/logs/filter_status_modal.dart b/lib/screens/logs/filter_status_modal.dart index a1b54e1..043c8c4 100644 --- a/lib/screens/logs/filter_status_modal.dart +++ b/lib/screens/logs/filter_status_modal.dart @@ -57,7 +57,6 @@ class _FilterStatusModalState extends State { Icon( icon, size: 24, - color: Theme.of(context).listTileTheme.iconColor, ), const SizedBox(width: 20), Text( diff --git a/lib/screens/logs/log_list_tile.dart b/lib/screens/logs/log_list_tile.dart index 661e9d2..c6eb9b0 100644 --- a/lib/screens/logs/log_list_tile.dart +++ b/lib/screens/logs/log_list_tile.dart @@ -30,7 +30,6 @@ class LogListTile extends StatelessWidget { Icon( icon, size: 24, - color: Theme.of(context).listTileTheme.iconColor, ), const SizedBox(width: 20), Column( diff --git a/lib/screens/logs/logs_filters_modal.dart b/lib/screens/logs/logs_filters_modal.dart index 56ffc3c..04d6e1f 100644 --- a/lib/screens/logs/logs_filters_modal.dart +++ b/lib/screens/logs/logs_filters_modal.dart @@ -1,5 +1,6 @@ // ignore_for_file: use_build_context_synchronously +import 'package:adguard_home_manager/widgets/custom_list_tile.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -170,7 +171,7 @@ class _LogsFiltersModalWidgetState extends State { return Padding( padding: MediaQuery.of(context).viewInsets, child: Container( - height: 380, + height: 400, decoration: BoxDecoration( color: Theme.of(context).dialogBackgroundColor, borderRadius: const BorderRadius.only( @@ -182,7 +183,7 @@ class _LogsFiltersModalWidgetState extends State { children: [ Expanded( child: ListView( - physics: 380 < MediaQuery.of(context).size.height + physics: 400 < MediaQuery.of(context).size.height ? const NeverScrollableScrollPhysics() : null, children: [ @@ -278,44 +279,11 @@ class _LogsFiltersModalWidgetState extends State { // ), // ), // ), - Material( - color: Colors.transparent, - child: InkWell( - onTap: openSelectFilterStatus, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), - child: Row( - children: [ - Icon( - Icons.shield_rounded, - size: 24, - color: Theme.of(context).listTileTheme.iconColor, - ), - const SizedBox(width: 20), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - AppLocalizations.of(context)!.responseStatus, - style: const TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500 - ), - ), - const SizedBox(height: 5), - Text( - "${translatedString[logsProvider.selectedResultStatus]}", - style: TextStyle( - fontSize: 14, - color: Theme.of(context).listTileTheme.iconColor, - ), - ) - ], - ) - ], - ), - ), - ), + CustomListTile( + title: AppLocalizations.of(context)!.responseStatus, + subtitle: "${translatedString[logsProvider.selectedResultStatus]}", + onTap: openSelectFilterStatus, + icon: Icons.shield_rounded, ), ], ), diff --git a/lib/widgets/custom_list_tile.dart b/lib/widgets/custom_list_tile.dart index 20ac840..545b22f 100644 --- a/lib/widgets/custom_list_tile.dart +++ b/lib/widgets/custom_list_tile.dart @@ -35,7 +35,6 @@ class CustomListTile extends StatelessWidget { if (icon != null) ...[ Icon( icon, - color: Theme.of(context).listTileTheme.iconColor, ), const SizedBox(width: 20), ],