diff --git a/lib/screens/app_logs/app_logs.dart b/lib/screens/app_logs/app_logs.dart index f39cc1eb..6f97fe99 100644 --- a/lib/screens/app_logs/app_logs.dart +++ b/lib/screens/app_logs/app_logs.dart @@ -53,46 +53,49 @@ class AppLogs extends StatelessWidget { const SizedBox(width: 10), ], ), - body: appConfigProvider.logs.isNotEmpty - ? ListView.builder( - padding: const EdgeInsets.only(top: 0), - itemCount: appConfigProvider.logs.length, - itemBuilder: (context, index) => ListTile( - title: Text( - appConfigProvider.logs[index].message, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.normal, - color: Theme.of(context).colorScheme.onSurface, + body: SafeArea( + child: appConfigProvider.logs.isNotEmpty + ? ListView.builder( + padding: const EdgeInsets.only(top: 0), + itemCount: appConfigProvider.logs.length, + itemBuilder: (context, index) => ListTile( + title: Text( + appConfigProvider.logs[index].message, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.normal, + color: Theme.of(context).colorScheme.onSurface, + ), + ), + subtitle: Text( + appConfigProvider.logs[index].dateTime.toString(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.normal, + color: Theme.of(context).listTileTheme.textColor, + ), ), + trailing: Text(appConfigProvider.logs[index].type), + onTap: () => { + showDialog( + context: context, + builder: (context) => AppLogDetailsModal( + log: appConfigProvider.logs[index], + ), + ), + }, ), - subtitle: Text( - appConfigProvider.logs[index].dateTime.toString(), + ) + : Center( + child: Text( + AppLocalizations.of(context)!.noSavedLogs, style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Theme.of(context).listTileTheme.textColor, + fontSize: 24, + color: Theme.of(context).colorScheme.onSurfaceVariant, ), ), - trailing: Text(appConfigProvider.logs[index].type), - onTap: () => { - showDialog( - context: context, - builder: (context) => - AppLogDetailsModal(log: appConfigProvider.logs[index]), - ), - }, ), - ) - : Center( - child: Text( - AppLocalizations.of(context)!.noSavedLogs, - style: TextStyle( - fontSize: 24, - color: Theme.of(context).colorScheme.onSurfaceVariant, - ), - ), - ), + ), ); } } diff --git a/lib/screens/domains/domain_details_screen.dart b/lib/screens/domains/domain_details_screen.dart index 0a6d2133..d14d3851 100644 --- a/lib/screens/domains/domain_details_screen.dart +++ b/lib/screens/domains/domain_details_screen.dart @@ -44,60 +44,62 @@ class DomainDetailsScreen extends StatelessWidget { const SizedBox(width: 10), ], ), - body: ListView( - children: [ - CustomListTile( - leadingIcon: Icons.domain, - label: AppLocalizations.of(context)!.domain, - description: domain.domain, - ), - CustomListTile( - leadingIcon: Icons.category_rounded, - label: AppLocalizations.of(context)!.type, - description: getDomainType(domain.type), - color: colors != null - ? convertColorFromNumber(colors!, domain.type) - : null, - ), - CustomListTile( - leadingIcon: Icons.schedule_rounded, - label: AppLocalizations.of(context)!.dateAdded, - description: formatTimestamp(domain.dateAdded, 'yyyy-MM-dd'), - ), - CustomListTile( - leadingIcon: Icons.update_rounded, - label: AppLocalizations.of(context)!.dateModified, - description: formatTimestamp(domain.dateModified, 'yyyy-MM-dd'), - ), - CustomListTile( - leadingIcon: Icons.check, - label: AppLocalizations.of(context)!.status, - description: domain.enabled == 1 - ? AppLocalizations.of(context)!.enabled - : AppLocalizations.of(context)!.disabled, - ), - Material( - color: Colors.transparent, - child: InkWell( - onTap: domain.comment != null && domain.comment != '' - ? () => { - showModal( - context: context, - builder: (context) => - DomainCommentModal(comment: domain.comment!), - ), - } + body: SafeArea( + child: ListView( + children: [ + CustomListTile( + leadingIcon: Icons.domain, + label: AppLocalizations.of(context)!.domain, + description: domain.domain, + ), + CustomListTile( + leadingIcon: Icons.category_rounded, + label: AppLocalizations.of(context)!.type, + description: getDomainType(domain.type), + color: colors != null + ? convertColorFromNumber(colors!, domain.type) : null, - child: CustomListTile( - leadingIcon: Icons.comment_rounded, - label: AppLocalizations.of(context)!.comment, - description: domain.comment == '' - ? AppLocalizations.of(context)!.noComment - : domain.comment, + ), + CustomListTile( + leadingIcon: Icons.schedule_rounded, + label: AppLocalizations.of(context)!.dateAdded, + description: formatTimestamp(domain.dateAdded, 'yyyy-MM-dd'), + ), + CustomListTile( + leadingIcon: Icons.update_rounded, + label: AppLocalizations.of(context)!.dateModified, + description: formatTimestamp(domain.dateModified, 'yyyy-MM-dd'), + ), + CustomListTile( + leadingIcon: Icons.check, + label: AppLocalizations.of(context)!.status, + description: domain.enabled == 1 + ? AppLocalizations.of(context)!.enabled + : AppLocalizations.of(context)!.disabled, + ), + Material( + color: Colors.transparent, + child: InkWell( + onTap: domain.comment != null && domain.comment != '' + ? () => { + showModal( + context: context, + builder: (context) => + DomainCommentModal(comment: domain.comment!), + ), + } + : null, + child: CustomListTile( + leadingIcon: Icons.comment_rounded, + label: AppLocalizations.of(context)!.comment, + description: domain.comment == '' + ? AppLocalizations.of(context)!.noComment + : domain.comment, + ), ), ), - ), - ], + ], + ), ), ); } diff --git a/lib/screens/domains/domains.dart b/lib/screens/domains/domains.dart index 13fd60f3..2af1f942 100644 --- a/lib/screens/domains/domains.dart +++ b/lib/screens/domains/domains.dart @@ -225,7 +225,12 @@ class _DomainListsWidgetState extends State if (MediaQuery.of(context).size.width > ResponsiveConstants.large) { return Row( children: [ - Expanded(flex: 2, child: scaffold()), + Expanded( + flex: MediaQuery.of(context).size.width > ResponsiveConstants.xLarge + ? 2 + : 3, + child: scaffold(), + ), Expanded( flex: 3, child: selectedDomain != null @@ -238,12 +243,14 @@ class _DomainListsWidgetState extends State colors: serversProvider.colors, ) : SizedBox( - child: Text( - AppLocalizations.of(context)!.selectDomainsLeftColumn, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 24, - color: Theme.of(context).colorScheme.onSurfaceVariant, + child: SafeArea( + child: Text( + AppLocalizations.of(context)!.selectDomainsLeftColumn, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 24, + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), ), ), ), diff --git a/lib/screens/domains/domains_list.dart b/lib/screens/domains/domains_list.dart index aaf669db..c7abbfc4 100644 --- a/lib/screens/domains/domains_list.dart +++ b/lib/screens/domains/domains_list.dart @@ -264,18 +264,24 @@ class _DomainsListState extends State { onRefresh: () async => await domainsListProvider .fetchDomainsList(serversProvider.selectedServer!), ), - AnimatedPositioned( - duration: const Duration(milliseconds: 100), - curve: Curves.easeInOut, - bottom: isVisible - ? appConfigProvider.showingSnackbar - ? 70 - : 20 - : -70, - right: 20, - child: FloatingActionButton( - onPressed: openModalAddDomainToList, - child: const Icon(Icons.add), + SafeArea( + child: Stack( + children: [ + AnimatedPositioned( + duration: const Duration(milliseconds: 100), + curve: Curves.easeInOut, + bottom: isVisible + ? appConfigProvider.showingSnackbar + ? 70 + : 20 + : -70, + right: 20, + child: FloatingActionButton( + onPressed: openModalAddDomainToList, + child: const Icon(Icons.add), + ), + ), + ], ), ), ], diff --git a/lib/screens/home/home.dart b/lib/screens/home/home.dart index 2c63a318..a9476a69 100644 --- a/lib/screens/home/home.dart +++ b/lib/screens/home/home.dart @@ -219,63 +219,73 @@ class _HomeState extends State { ? Stack( children: [ Scaffold( - body: NestedScrollView( - headerSliverBuilder: - (BuildContext context, bool innerBoxIsScrolled) { - return [ - SliverOverlapAbsorber( - handle: NestedScrollView.sliverOverlapAbsorberHandleFor( - context, + body: SafeArea( + child: NestedScrollView( + headerSliverBuilder: + (BuildContext context, bool innerBoxIsScrolled) { + return [ + SliverOverlapAbsorber( + handle: + NestedScrollView.sliverOverlapAbsorberHandleFor( + context, + ), + sliver: HomeAppBar( + innerBoxIsScrolled: innerBoxIsScrolled, + ), ), - sliver: HomeAppBar( - innerBoxIsScrolled: innerBoxIsScrolled, - ), - ), - ]; - }, - body: SafeArea( - top: false, - bottom: false, - child: Builder( - builder: (context) => RefreshIndicator( - edgeOffset: 70, - onRefresh: () async { - await refreshServerStatus(context); - }, - child: CustomScrollView( - slivers: [ - SliverOverlapInjector( - handle: NestedScrollView - .sliverOverlapAbsorberHandleFor(context), - ), - SliverList.list( - children: [ - tiles(), - const SizedBox(height: 24), - const HomeCharts(), - const SizedBox(height: 16), - ], - ), - ], + ]; + }, + body: SafeArea( + top: false, + bottom: false, + child: Builder( + builder: (context) => RefreshIndicator( + edgeOffset: 70, + onRefresh: () async { + await refreshServerStatus(context); + }, + child: CustomScrollView( + slivers: [ + SliverOverlapInjector( + handle: NestedScrollView + .sliverOverlapAbsorberHandleFor(context), + ), + SliverList.list( + children: [ + tiles(), + const SizedBox(height: 24), + const HomeCharts(), + const SizedBox(height: 16), + ], + ), + ], + ), ), ), ), ), ), ), - AnimatedPositioned( - duration: const Duration(milliseconds: 100), - curve: Curves.easeInOut, - bottom: isVisible && - statusProvider.getStatusLoading == LoadStatus.loaded - ? appConfigProvider.showingSnackbar - ? 70 - : 20 - : -70, - right: 20, - child: FloatingActionButton( - onPressed: enableDisableServer, - child: const Icon(Icons.shield_rounded), + SafeArea( + child: Stack( + children: [ + AnimatedPositioned( + duration: const Duration(milliseconds: 100), + curve: Curves.easeInOut, + bottom: isVisible && + statusProvider.getStatusLoading == + LoadStatus.loaded + ? appConfigProvider.showingSnackbar + ? 70 + : 20 + : -70, + right: 20, + child: FloatingActionButton( + onPressed: enableDisableServer, + child: const Icon(Icons.shield_rounded), + ), + ), + ], ), ), ], diff --git a/lib/screens/logs/log_details_screen.dart b/lib/screens/logs/log_details_screen.dart index 7780fcd4..779c3de0 100644 --- a/lib/screens/logs/log_details_screen.dart +++ b/lib/screens/logs/log_details_screen.dart @@ -92,47 +92,49 @@ class LogDetailsScreen extends StatelessWidget { const SizedBox(width: 10), ], ), - body: ListView( - children: [ - CustomListTile( - leadingIcon: Icons.link, - label: AppLocalizations.of(context)!.url, - description: log.url, - ), - CustomListTile( - leadingIcon: Icons.http_rounded, - label: AppLocalizations.of(context)!.type, - description: log.type, - ), - CustomListTile( - leadingIcon: Icons.phone_android_rounded, - label: AppLocalizations.of(context)!.device, - description: log.device, - ), - CustomListTile( - leadingIcon: Icons.access_time_outlined, - label: AppLocalizations.of(context)!.time, - description: formatTimestamp(log.dateTime, 'HH:mm:ss'), - ), - if (log.status != null) - item( - Icons.shield_outlined, - AppLocalizations.of(context)!.status, - LogStatus(status: log.status!, showIcon: false), + body: SafeArea( + child: ListView( + children: [ + CustomListTile( + leadingIcon: Icons.link, + label: AppLocalizations.of(context)!.url, + description: log.url, ), - if (log.status == '2' && log.answeredBy != null) CustomListTile( - leadingIcon: Icons.domain, - label: AppLocalizations.of(context)!.answeredBy, - description: log.answeredBy!, + leadingIcon: Icons.http_rounded, + label: AppLocalizations.of(context)!.type, + description: log.type, ), - CustomListTile( - leadingIcon: Icons.system_update_alt_outlined, - label: AppLocalizations.of(context)!.reply, - description: - '${log.replyType} (${(log.replyTime / BigInt.from(10))} ms)', - ), - ], + CustomListTile( + leadingIcon: Icons.phone_android_rounded, + label: AppLocalizations.of(context)!.device, + description: log.device, + ), + CustomListTile( + leadingIcon: Icons.access_time_outlined, + label: AppLocalizations.of(context)!.time, + description: formatTimestamp(log.dateTime, 'HH:mm:ss'), + ), + if (log.status != null) + item( + Icons.shield_outlined, + AppLocalizations.of(context)!.status, + LogStatus(status: log.status!, showIcon: false), + ), + if (log.status == '2' && log.answeredBy != null) + CustomListTile( + leadingIcon: Icons.domain, + label: AppLocalizations.of(context)!.answeredBy, + description: log.answeredBy!, + ), + CustomListTile( + leadingIcon: Icons.system_update_alt_outlined, + label: AppLocalizations.of(context)!.reply, + description: + '${log.replyType} (${(log.replyTime / BigInt.from(10))} ms)', + ), + ], + ), ), ); } diff --git a/lib/screens/logs/logs.dart b/lib/screens/logs/logs.dart index fcfeec22..48eda250 100644 --- a/lib/screens/logs/logs.dart +++ b/lib/screens/logs/logs.dart @@ -693,14 +693,19 @@ class _LogsState extends State { child: SizedBox(), ), ), - body: status(), + body: SafeArea( + child: status(), + ), ); } if (width > ResponsiveConstants.large) { return Row( children: [ - Expanded(flex: 2, child: scaffold()), + Expanded( + flex: width > ResponsiveConstants.xLarge ? 2 : 3, + child: scaffold(), + ), Expanded( flex: 3, child: selectedLog != null @@ -709,12 +714,14 @@ class _LogsState extends State { whiteBlackList: whiteBlackList, ) : SizedBox( - child: Text( - AppLocalizations.of(context)!.selectLogsLeftColumn, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 24, - color: Theme.of(context).colorScheme.onSurfaceVariant, + child: SafeArea( + child: Text( + AppLocalizations.of(context)!.selectLogsLeftColumn, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 24, + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), ), ), ), diff --git a/lib/screens/servers/servers.dart b/lib/screens/servers/servers.dart index 2023fd54..5d4ee5fa 100644 --- a/lib/screens/servers/servers.dart +++ b/lib/screens/servers/servers.dart @@ -133,30 +133,32 @@ class _ServersPageState extends State { appBar: AppBar( title: Text(AppLocalizations.of(context)!.servers), ), - body: Stack( - children: [ - ServersList( - context: context, - controllers: expandableControllerList, - onChange: expandOrContract, - scrollController: scrollController, - breakingWidth: ResponsiveConstants.medium, - ), - AnimatedPositioned( - duration: const Duration(milliseconds: 100), - curve: Curves.easeInOut, - bottom: isVisible - ? appConfigProvider.showingSnackbar - ? 70 - : (Platform.isIOS ? 40 : 20) - : -70, - right: 20, - child: FloatingActionButton( - onPressed: openAddServer, - child: const Icon(Icons.add), + body: SafeArea( + child: Stack( + children: [ + ServersList( + context: context, + controllers: expandableControllerList, + onChange: expandOrContract, + scrollController: scrollController, + breakingWidth: ResponsiveConstants.medium, ), - ), - ], + AnimatedPositioned( + duration: const Duration(milliseconds: 100), + curve: Curves.easeInOut, + bottom: isVisible + ? appConfigProvider.showingSnackbar + ? 70 + : (Platform.isIOS ? 40 : 20) + : -70, + right: 20, + child: FloatingActionButton( + onPressed: openAddServer, + child: const Icon(Icons.add), + ), + ), + ], + ), ), ), ); diff --git a/lib/screens/servers/servers_tile_item.dart b/lib/screens/servers/servers_tile_item.dart index 85acbd00..2ce1cfe4 100644 --- a/lib/screens/servers/servers_tile_item.dart +++ b/lib/screens/servers/servers_tile_item.dart @@ -395,9 +395,9 @@ class _ServersTileItemState extends State } return FractionallySizedBox( - widthFactor: width > ResponsiveConstants.large ? 0.5 : 1, + widthFactor: width > ResponsiveConstants.xLarge ? 0.5 : 1, child: Card( - margin: width > ResponsiveConstants.large + margin: width > ResponsiveConstants.xLarge ? generateMargins(widget.index) : const EdgeInsets.symmetric(vertical: 8, horizontal: 16), child: Column( diff --git a/lib/screens/settings/about/licenses_screen.dart b/lib/screens/settings/about/licenses_screen.dart index 69151226..a1bcd97e 100644 --- a/lib/screens/settings/about/licenses_screen.dart +++ b/lib/screens/settings/about/licenses_screen.dart @@ -23,19 +23,25 @@ class LicensesScreen extends StatelessWidget { } else if (snapshot.hasData) { final packageInfo = snapshot.data!; return Scaffold( - body: LicensePage( - applicationVersion: packageInfo.version, - applicationIcon: Image.asset( - 'assets/icon/icon-foreground.png', - width: 48, - height: 48, + body: SafeArea( + child: LicensePage( + applicationVersion: packageInfo.version, + applicationIcon: Image.asset( + 'assets/icon/icon-foreground.png', + width: 48, + height: 48, + ), + applicationLegalese: '© ${DateTime.now().year} tsutsu3', ), - applicationLegalese: '© ${DateTime.now().year} tsutsu3', ), ); } else { return const Scaffold( - body: Center(child: Text('Unexpected error occurred')), + body: SafeArea( + child: Center( + child: Text('Unexpected error occurred'), + ), + ), ); } }, diff --git a/lib/screens/settings/app_settings/advanced_settings/advanced_options.dart b/lib/screens/settings/app_settings/advanced_settings/advanced_options.dart index 465979a3..5de89f71 100644 --- a/lib/screens/settings/app_settings/advanced_settings/advanced_options.dart +++ b/lib/screens/settings/app_settings/advanced_settings/advanced_options.dart @@ -175,115 +175,129 @@ class AdvancedOptions extends StatelessWidget { systemOverlayStyle: systemUiOverlayStyleConfig(context), title: Text(AppLocalizations.of(context)!.advancedSetup), ), - body: ListView( - children: [ - SectionLabel(label: AppLocalizations.of(context)!.security), - CustomListTile( - leadingIcon: Icons.lock, - label: AppLocalizations.of(context)!.dontCheckCertificate, - description: - AppLocalizations.of(context)!.dontCheckCertificateDescription, - trailing: Switch( - value: appConfigProvider.overrideSslCheck, - onChanged: updateSslCheck, - ), - onTap: () => updateSslCheck(!appConfigProvider.overrideSslCheck), - padding: const EdgeInsets.only( - top: 10, - bottom: 10, - left: 20, - right: 10, - ), - ), - CustomListTile( - leadingIcon: Icons.fingerprint_rounded, - label: AppLocalizations.of(context)!.appUnlock, - description: AppLocalizations.of(context)!.appUnlockDescription, - onTap: openAppUnlockModal, - padding: const EdgeInsets.only( - top: 10, - bottom: 10, - left: 20, - right: 10, + body: SafeArea( + child: ListView( + children: [ + SectionLabel(label: AppLocalizations.of(context)!.security), + CustomListTile( + leadingIcon: Icons.lock, + label: AppLocalizations.of(context)!.dontCheckCertificate, + description: + AppLocalizations.of(context)!.dontCheckCertificateDescription, + trailing: Switch( + value: appConfigProvider.overrideSslCheck, + onChanged: updateSslCheck, + ), + onTap: () => updateSslCheck(!appConfigProvider.overrideSslCheck), + padding: const EdgeInsets.only( + top: 10, + bottom: 10, + left: 20, + right: 10, + ), ), - ), - SectionLabel(label: AppLocalizations.of(context)!.charts), - CustomListTile( - leadingIcon: Icons.stacked_line_chart_rounded, - label: AppLocalizations.of(context)!.reducedDataCharts, - description: - AppLocalizations.of(context)!.reducedDataChartsDescription, - onTap: () => - updateUseReducedData(!appConfigProvider.reducedDataCharts), - padding: - const EdgeInsets.only(top: 10, bottom: 10, left: 20, right: 10), - trailing: Switch( - value: appConfigProvider.reducedDataCharts, - onChanged: updateUseReducedData, + CustomListTile( + leadingIcon: Icons.fingerprint_rounded, + label: AppLocalizations.of(context)!.appUnlock, + description: AppLocalizations.of(context)!.appUnlockDescription, + onTap: openAppUnlockModal, + padding: const EdgeInsets.only( + top: 10, + bottom: 10, + left: 20, + right: 10, + ), ), - ), - CustomListTile( - leadingIcon: Icons.exposure_zero_rounded, - label: AppLocalizations.of(context)!.hideZeroValues, - description: - AppLocalizations.of(context)!.hideZeroValuesDescription, - onTap: () => - updateHideZeroValues(!appConfigProvider.hideZeroValues), - padding: - const EdgeInsets.only(top: 10, bottom: 10, left: 20, right: 10), - trailing: Switch( - value: appConfigProvider.hideZeroValues, - onChanged: updateHideZeroValues, + SectionLabel(label: AppLocalizations.of(context)!.charts), + CustomListTile( + leadingIcon: Icons.stacked_line_chart_rounded, + label: AppLocalizations.of(context)!.reducedDataCharts, + description: + AppLocalizations.of(context)!.reducedDataChartsDescription, + onTap: () => + updateUseReducedData(!appConfigProvider.reducedDataCharts), + padding: const EdgeInsets.only( + top: 10, + bottom: 10, + left: 20, + right: 10, + ), + trailing: Switch( + value: appConfigProvider.reducedDataCharts, + onChanged: updateUseReducedData, + ), ), - ), - CustomListTile( - leadingIcon: Icons.pie_chart_rounded, - label: AppLocalizations.of(context)!.domainsClientsDataMode, - description: - AppLocalizations.of(context)!.domainsClientsDataModeDescription, - onTap: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const StatisticsVisualizationScreen(), + CustomListTile( + leadingIcon: Icons.exposure_zero_rounded, + label: AppLocalizations.of(context)!.hideZeroValues, + description: + AppLocalizations.of(context)!.hideZeroValuesDescription, + onTap: () => + updateHideZeroValues(!appConfigProvider.hideZeroValues), + padding: const EdgeInsets.only( + top: 10, + bottom: 10, + left: 20, + right: 10, + ), + trailing: Switch( + value: appConfigProvider.hideZeroValues, + onChanged: updateHideZeroValues, ), ), - padding: - const EdgeInsets.only(top: 10, bottom: 10, left: 20, right: 10), - ), - SectionLabel(label: AppLocalizations.of(context)!.others), - CustomListTile( - leadingIcon: Icons.list, - label: AppLocalizations.of(context)!.appLogs, - description: AppLocalizations.of(context)!.errorsApp, - onTap: () => { - Navigator.push( + CustomListTile( + leadingIcon: Icons.pie_chart_rounded, + label: AppLocalizations.of(context)!.domainsClientsDataMode, + description: AppLocalizations.of(context)! + .domainsClientsDataModeDescription, + onTap: () => Navigator.push( context, MaterialPageRoute( - builder: (context) => const AppLogs(), + builder: (context) => const StatisticsVisualizationScreen(), ), ), - }, - padding: const EdgeInsets.only( - top: 10, - bottom: 10, - left: 20, - right: 10, + padding: const EdgeInsets.only( + top: 10, + bottom: 10, + left: 20, + right: 10, + ), ), - ), - CustomListTile( - leadingIcon: Icons.delete, - label: AppLocalizations.of(context)!.resetApplication, - description: AppLocalizations.of(context)!.erasesAppData, - color: convertColor(serversProvider.colors, Colors.red), - onTap: openResetModal, - padding: const EdgeInsets.only( - top: 10, - bottom: 10, - left: 20, - right: 10, + SectionLabel(label: AppLocalizations.of(context)!.others), + CustomListTile( + leadingIcon: Icons.list, + label: AppLocalizations.of(context)!.appLogs, + description: AppLocalizations.of(context)!.errorsApp, + onTap: () => { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const AppLogs(), + ), + ), + }, + padding: const EdgeInsets.only( + top: 10, + bottom: 10, + left: 20, + right: 10, + ), ), - ), - ], + CustomListTile( + leadingIcon: Icons.delete, + label: AppLocalizations.of(context)!.resetApplication, + description: AppLocalizations.of(context)!.erasesAppData, + color: convertColor(serversProvider.colors, Colors.red), + onTap: openResetModal, + padding: const EdgeInsets.only( + top: 10, + bottom: 10, + left: 20, + right: 10, + ), + ), + ], + ), ), ); } diff --git a/lib/screens/settings/app_settings/advanced_settings/statistics_visualization_screen.dart b/lib/screens/settings/app_settings/advanced_settings/statistics_visualization_screen.dart index ceb7052f..d614978b 100644 --- a/lib/screens/settings/app_settings/advanced_settings/statistics_visualization_screen.dart +++ b/lib/screens/settings/app_settings/advanced_settings/statistics_visualization_screen.dart @@ -101,23 +101,25 @@ class StatisticsVisualizationScreen extends StatelessWidget { appBar: AppBar( title: Text(AppLocalizations.of(context)!.domainsClientsDataMode), ), - body: ListView( - children: [ - const SizedBox(height: 16), - item( - AppLocalizations.of(context)!.list, - AppLocalizations.of(context)!.listDescription, - Icons.list_rounded, - 0, - ), - const SizedBox(height: 24), - item( - AppLocalizations.of(context)!.pieChart, - AppLocalizations.of(context)!.pieChartDescription, - Icons.pie_chart_rounded, - 1, - ), - ], + body: SafeArea( + child: ListView( + children: [ + const SizedBox(height: 16), + item( + AppLocalizations.of(context)!.list, + AppLocalizations.of(context)!.listDescription, + Icons.list_rounded, + 0, + ), + const SizedBox(height: 24), + item( + AppLocalizations.of(context)!.pieChart, + AppLocalizations.of(context)!.pieChartDescription, + Icons.pie_chart_rounded, + 1, + ), + ], + ), ), ); } diff --git a/lib/screens/settings/app_settings/auto_refresh_time_screen.dart b/lib/screens/settings/app_settings/auto_refresh_time_screen.dart index 96650669..61402465 100644 --- a/lib/screens/settings/app_settings/auto_refresh_time_screen.dart +++ b/lib/screens/settings/app_settings/auto_refresh_time_screen.dart @@ -154,71 +154,73 @@ class _AutoRefreshTimeScreenState extends State { const SizedBox(width: 8), ], ), - body: ListView( - children: [ - CustomRadioListTile( - groupValue: selectedOption, - value: 0, - radioBackgroundColor: Theme.of(context).colorScheme.surface, - title: AppLocalizations.of(context)!.second1, - onChanged: _updateRadioValue, - ), - CustomRadioListTile( - groupValue: selectedOption, - value: 1, - radioBackgroundColor: Theme.of(context).colorScheme.surface, - title: AppLocalizations.of(context)!.seconds2, - onChanged: _updateRadioValue, - ), - CustomRadioListTile( - groupValue: selectedOption, - value: 2, - radioBackgroundColor: Theme.of(context).colorScheme.surface, - title: AppLocalizations.of(context)!.seconds5, - onChanged: _updateRadioValue, - ), - CustomRadioListTile( - groupValue: selectedOption, - value: 3, - radioBackgroundColor: Theme.of(context).colorScheme.surface, - title: AppLocalizations.of(context)!.seconds10, - onChanged: _updateRadioValue, - ), - CustomRadioListTile( - groupValue: selectedOption, - value: 4, - radioBackgroundColor: Theme.of(context).colorScheme.surface, - title: AppLocalizations.of(context)!.seconds30, - onChanged: _updateRadioValue, - ), - CustomRadioListTile( - groupValue: selectedOption, - value: 5, - radioBackgroundColor: Theme.of(context).colorScheme.surface, - title: AppLocalizations.of(context)!.custom, - onChanged: _updateRadioValue, - ), - if (showCustomDurationInput == true) - Padding( - padding: const EdgeInsets.all(16), - child: TextField( - onChanged: _validateCustomTime, - controller: customTimeController, - keyboardType: - const TextInputType.numberWithOptions(decimal: false), - decoration: InputDecoration( - errorText: - !customTimeIsValid && customTimeController.text != '' - ? AppLocalizations.of(context)!.valueNotValid - : null, - border: const OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10)), + body: SafeArea( + child: ListView( + children: [ + CustomRadioListTile( + groupValue: selectedOption, + value: 0, + radioBackgroundColor: Theme.of(context).colorScheme.surface, + title: AppLocalizations.of(context)!.second1, + onChanged: _updateRadioValue, + ), + CustomRadioListTile( + groupValue: selectedOption, + value: 1, + radioBackgroundColor: Theme.of(context).colorScheme.surface, + title: AppLocalizations.of(context)!.seconds2, + onChanged: _updateRadioValue, + ), + CustomRadioListTile( + groupValue: selectedOption, + value: 2, + radioBackgroundColor: Theme.of(context).colorScheme.surface, + title: AppLocalizations.of(context)!.seconds5, + onChanged: _updateRadioValue, + ), + CustomRadioListTile( + groupValue: selectedOption, + value: 3, + radioBackgroundColor: Theme.of(context).colorScheme.surface, + title: AppLocalizations.of(context)!.seconds10, + onChanged: _updateRadioValue, + ), + CustomRadioListTile( + groupValue: selectedOption, + value: 4, + radioBackgroundColor: Theme.of(context).colorScheme.surface, + title: AppLocalizations.of(context)!.seconds30, + onChanged: _updateRadioValue, + ), + CustomRadioListTile( + groupValue: selectedOption, + value: 5, + radioBackgroundColor: Theme.of(context).colorScheme.surface, + title: AppLocalizations.of(context)!.custom, + onChanged: _updateRadioValue, + ), + if (showCustomDurationInput == true) + Padding( + padding: const EdgeInsets.all(16), + child: TextField( + onChanged: _validateCustomTime, + controller: customTimeController, + keyboardType: + const TextInputType.numberWithOptions(decimal: false), + decoration: InputDecoration( + errorText: + !customTimeIsValid && customTimeController.text != '' + ? AppLocalizations.of(context)!.valueNotValid + : null, + border: const OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10)), + ), + labelText: AppLocalizations.of(context)!.customSeconds, ), - labelText: AppLocalizations.of(context)!.customSeconds, ), ), - ), - ], + ], + ), ), ); } diff --git a/lib/screens/settings/app_settings/language_screen.dart b/lib/screens/settings/app_settings/language_screen.dart index 13e2e119..22155551 100644 --- a/lib/screens/settings/app_settings/language_screen.dart +++ b/lib/screens/settings/app_settings/language_screen.dart @@ -32,40 +32,43 @@ class _LanguageScreenState extends State { appBar: AppBar( title: Text(AppLocalizations.of(context)!.language), ), - body: ListView( - children: [ - // System language - // Other languages - ...(languageOptions..sort((a, b) => a.key.compareTo(b.key))) - .map((languageOption) { - return Material( - color: Colors.transparent, - child: InkWell( - onTap: () { - setState(() => _selectedItem = languageOption.index); - appConfigProvider.setSelectedLanguage(languageOption.key); - }, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 10), - child: ListTile( - title: Text( - languageOption.displayName, - style: TextStyle( - fontWeight: FontWeight.normal, - color: getListTextColor(context), + body: SafeArea( + child: ListView( + children: [ + // System language + // Other languages + ...(languageOptions..sort((a, b) => a.key.compareTo(b.key))) + .map((languageOption) { + return Material( + color: Colors.transparent, + child: InkWell( + onTap: () { + setState(() => _selectedItem = languageOption.index); + appConfigProvider.setSelectedLanguage(languageOption.key); + }, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 10), + child: ListTile( + title: Text( + languageOption.displayName, + style: TextStyle( + fontWeight: FontWeight.normal, + color: getListTextColor(context), + ), + ), + trailing: CustomRadio( + value: languageOption.index, + groupValue: _selectedItem, + backgroundColor: + Theme.of(context).dialogBackgroundColor, ), - ), - trailing: CustomRadio( - value: languageOption.index, - groupValue: _selectedItem, - backgroundColor: Theme.of(context).dialogBackgroundColor, ), ), ), - ), - ); - }), - ], + ); + }), + ], + ), ), ); } diff --git a/lib/screens/settings/app_settings/logs_quantity_load_screen.dart b/lib/screens/settings/app_settings/logs_quantity_load_screen.dart index acb42d95..c695a5ef 100644 --- a/lib/screens/settings/app_settings/logs_quantity_load_screen.dart +++ b/lib/screens/settings/app_settings/logs_quantity_load_screen.dart @@ -115,96 +115,102 @@ class _LogsQuantityLoadScreenState extends State { const SizedBox(width: 8), ], ), - body: ListView( - children: [ - Padding( - padding: const EdgeInsets.only( - top: 10, - bottom: 20, - left: 20, - right: 20, - ), - child: Container( - padding: const EdgeInsets.all(20), - decoration: BoxDecoration( - color: Theme.of(context).extension()!.cardWarning!, - borderRadius: BorderRadius.circular(30), + body: SafeArea( + child: ListView( + children: [ + Padding( + padding: const EdgeInsets.only( + top: 10, + bottom: 20, + left: 20, + right: 20, ), - height: 100, - child: Row( - children: [ - Icon( - Icons.warning_rounded, - color: Theme.of(context) - .extension()! - .cardWarningText!, - ), - const SizedBox(width: 20), - Expanded( - child: Text( - AppLocalizations.of(context)!.logsPerQueryWarning, - style: TextStyle( - color: Theme.of(context) - .extension()! - .cardWarningText!, + child: Container( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: Theme.of(context).extension()!.cardWarning!, + borderRadius: BorderRadius.circular(30), + ), + height: 100, + child: Row( + children: [ + Icon( + Icons.warning_rounded, + color: Theme.of(context) + .extension()! + .cardWarningText!, + ), + const SizedBox(width: 20), + Expanded( + child: Text( + AppLocalizations.of(context)!.logsPerQueryWarning, + style: TextStyle( + color: Theme.of(context) + .extension()! + .cardWarningText!, + ), ), ), - ), - ], + ], + ), ), ), - ), - CustomRadioListTile( - groupValue: selectedOption, - value: 0, - radioBackgroundColor: Theme.of(context).colorScheme.surface, - title: AppLocalizations.of(context)!.minutes30, - onChanged: _updateRadioValue, - ), - CustomRadioListTile( - groupValue: selectedOption, - value: 1, - radioBackgroundColor: Theme.of(context).colorScheme.surface, - title: AppLocalizations.of(context)!.hour1, - onChanged: _updateRadioValue, - ), - CustomRadioListTile( - groupValue: selectedOption, - value: 2, - radioBackgroundColor: Theme.of(context).colorScheme.surface, - title: AppLocalizations.of(context)!.hours2, - onChanged: _updateRadioValue, - ), - CustomRadioListTile( - groupValue: selectedOption, - value: 3, - radioBackgroundColor: Theme.of(context).colorScheme.surface, - title: AppLocalizations.of(context)!.hours4, - onChanged: _updateRadioValue, - ), - CustomRadioListTile( - groupValue: selectedOption, - value: 4, - radioBackgroundColor: Theme.of(context).colorScheme.surface, - title: AppLocalizations.of(context)!.hours6, - onChanged: _updateRadioValue, - ), - CustomRadioListTile( - groupValue: selectedOption, - value: 5, - radioBackgroundColor: Theme.of(context).colorScheme.surface, - title: AppLocalizations.of(context)!.hours8, - onChanged: _updateRadioValue, - ), - Padding( - padding: - const EdgeInsets.only(top: 20, left: 20, bottom: 10, right: 20), - child: Text( - '${AppLocalizations.of(context)!.logsWillBeRequested} ${_getTime() == 0.5 ? '30' : _getTime().toInt()} ${_getTime() == 0.5 ? AppLocalizations.of(context)!.minutes : AppLocalizations.of(context)!.hours}', - style: const TextStyle(fontWeight: FontWeight.bold), + CustomRadioListTile( + groupValue: selectedOption, + value: 0, + radioBackgroundColor: Theme.of(context).colorScheme.surface, + title: AppLocalizations.of(context)!.minutes30, + onChanged: _updateRadioValue, ), - ), - ], + CustomRadioListTile( + groupValue: selectedOption, + value: 1, + radioBackgroundColor: Theme.of(context).colorScheme.surface, + title: AppLocalizations.of(context)!.hour1, + onChanged: _updateRadioValue, + ), + CustomRadioListTile( + groupValue: selectedOption, + value: 2, + radioBackgroundColor: Theme.of(context).colorScheme.surface, + title: AppLocalizations.of(context)!.hours2, + onChanged: _updateRadioValue, + ), + CustomRadioListTile( + groupValue: selectedOption, + value: 3, + radioBackgroundColor: Theme.of(context).colorScheme.surface, + title: AppLocalizations.of(context)!.hours4, + onChanged: _updateRadioValue, + ), + CustomRadioListTile( + groupValue: selectedOption, + value: 4, + radioBackgroundColor: Theme.of(context).colorScheme.surface, + title: AppLocalizations.of(context)!.hours6, + onChanged: _updateRadioValue, + ), + CustomRadioListTile( + groupValue: selectedOption, + value: 5, + radioBackgroundColor: Theme.of(context).colorScheme.surface, + title: AppLocalizations.of(context)!.hours8, + onChanged: _updateRadioValue, + ), + Padding( + padding: const EdgeInsets.only( + top: 20, + left: 20, + bottom: 10, + right: 20, + ), + child: Text( + '${AppLocalizations.of(context)!.logsWillBeRequested} ${_getTime() == 0.5 ? '30' : _getTime().toInt()} ${_getTime() == 0.5 ? AppLocalizations.of(context)!.minutes : AppLocalizations.of(context)!.hours}', + style: const TextStyle(fontWeight: FontWeight.bold), + ), + ), + ], + ), ), ); } diff --git a/lib/screens/settings/app_settings/theme_screen.dart b/lib/screens/settings/app_settings/theme_screen.dart index 70269806..ca21f910 100644 --- a/lib/screens/settings/app_settings/theme_screen.dart +++ b/lib/screens/settings/app_settings/theme_screen.dart @@ -67,30 +67,32 @@ class _ThemeScreenState extends State { appBar: AppBar( title: Text(AppLocalizations.of(context)!.theme), ), - body: ListView( - children: [ - _buildThemeRow( - context, - icon: Icons.phone_android_rounded, - text: AppLocalizations.of(context)!.systemTheme, - value: 0, - appConfigProvider: appConfigProvider, - ), - _buildThemeRow( - context, - icon: Icons.light_mode_rounded, - text: AppLocalizations.of(context)!.light, - value: 1, - appConfigProvider: appConfigProvider, - ), - _buildThemeRow( - context, - icon: Icons.dark_mode_rounded, - text: AppLocalizations.of(context)!.dark, - value: 2, - appConfigProvider: appConfigProvider, - ), - ], + body: SafeArea( + child: ListView( + children: [ + _buildThemeRow( + context, + icon: Icons.phone_android_rounded, + text: AppLocalizations.of(context)!.systemTheme, + value: 0, + appConfigProvider: appConfigProvider, + ), + _buildThemeRow( + context, + icon: Icons.light_mode_rounded, + text: AppLocalizations.of(context)!.light, + value: 1, + appConfigProvider: appConfigProvider, + ), + _buildThemeRow( + context, + icon: Icons.dark_mode_rounded, + text: AppLocalizations.of(context)!.dark, + value: 2, + appConfigProvider: appConfigProvider, + ), + ], + ), ), ); } diff --git a/lib/screens/settings/settings.dart b/lib/screens/settings/settings.dart index 9f9611c6..0d18719a 100644 --- a/lib/screens/settings/settings.dart +++ b/lib/screens/settings/settings.dart @@ -38,14 +38,16 @@ class Settings extends StatelessWidget { hideDivider: true, // flexWidth: const FlexWidth(mainViewFlexWidth: 1, secondaryViewFlexWidth: 2), placeholder: Center( - child: Padding( - padding: const EdgeInsets.all(24), - child: Text( - AppLocalizations.of(context)!.selectOptionLeftColumn, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 24, - color: Theme.of(context).colorScheme.onSurfaceVariant, + child: SafeArea( + child: Padding( + padding: const EdgeInsets.all(24), + child: Text( + AppLocalizations.of(context)!.selectOptionLeftColumn, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 24, + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), ), ), ), @@ -170,153 +172,158 @@ class _SettingsWidgetState extends State { } return Scaffold( - body: NestedScrollView( - headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { - return [ - SliverOverlapAbsorber( - handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), - sliver: SliverAppBar.large( - pinned: true, - floating: true, - centerTitle: false, - forceElevated: innerBoxIsScrolled, - title: Text(AppLocalizations.of(context)!.settings), - ), - ), - ]; - }, - body: SafeArea( - top: false, - bottom: false, - child: Builder( - builder: (context) => CustomScrollView( - slivers: [ - SliverOverlapInjector( - handle: NestedScrollView.sliverOverlapAbsorberHandleFor( - context, - ), + body: SafeArea( + child: NestedScrollView( + headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { + return [ + SliverOverlapAbsorber( + handle: + NestedScrollView.sliverOverlapAbsorberHandleFor(context), + sliver: SliverAppBar.large( + pinned: true, + floating: true, + centerTitle: false, + forceElevated: innerBoxIsScrolled, + title: Text(AppLocalizations.of(context)!.settings), ), - SliverList.list( - children: [ - SectionLabel( - label: AppLocalizations.of(context)!.appSettings, - ), - settingsTile( - icon: Icons.light_mode_rounded, - title: AppLocalizations.of(context)!.theme, - subtitle: getThemeString(), - thisItem: 0, - screenToNavigate: const ThemeScreen(), - ), - settingsTile( - icon: Icons.language, - title: AppLocalizations.of(context)!.language, - subtitle: getLanguageString(), - thisItem: 1, - screenToNavigate: const LanguageScreen(), - ), - settingsTile( - icon: Icons.storage_rounded, - title: AppLocalizations.of(context)!.servers, - subtitle: serversProvider.selectedServer != null - ? statusProvider.isServerConnected == true - ? '${AppLocalizations.of(context)!.connectedTo} ${serversProvider.selectedServer!.alias}' - : AppLocalizations.of(context)!.notConnectServer - : AppLocalizations.of(context)!.notSelected, - screenToNavigate: const ServersPage(), - thisItem: 2, - ), - settingsTile( - icon: Icons.update, - title: AppLocalizations.of(context)!.autoRefreshTime, - subtitle: - '${appConfigProvider.getAutoRefreshTime.toString()} ${AppLocalizations.of(context)!.seconds}', - thisItem: 3, - screenToNavigate: const AutoRefreshTimeScreen(), - ), - settingsTile( - icon: Icons.list_rounded, - title: AppLocalizations.of(context)!.logsQuantityPerLoad, - subtitle: - '${appConfigProvider.logsPerQuery == 0.5 ? '30' : appConfigProvider.logsPerQuery.toInt()} ${appConfigProvider.logsPerQuery == 0.5 ? AppLocalizations.of(context)!.minutes : AppLocalizations.of(context)!.hours}', - thisItem: 4, - screenToNavigate: const LogsQuantityLoadScreen(), - ), - settingsTile( - icon: Icons.settings, - title: AppLocalizations.of(context)!.advancedSetup, - subtitle: AppLocalizations.of(context)! - .advancedSetupDescription, - screenToNavigate: const AdvancedOptions(), - thisItem: 5, - ), - SectionLabel( - label: AppLocalizations.of(context)!.about, - ), - CustomListTile( - label: AppLocalizations.of(context)!.applicationDetail, - description: AppLocalizations.of(context)!.aboutThisApp, - onTap: openAppDetailModal, - ), - CustomListTile( - label: AppLocalizations.of(context)!.privacy, - description: AppLocalizations.of(context)!.privacyInfo, - onTap: openPrivacyModal, - ), - CustomListTile( - label: AppLocalizations.of(context)!.importantInformation, - description: AppLocalizations.of(context)!.readIssues, - onTap: openImportantInformationModal, - ), - CustomListTile( - label: AppLocalizations.of(context)!.legal, - description: AppLocalizations.of(context)!.legalInfo, - onTap: openLegalModal, - ), - settingsTile( - title: AppLocalizations.of(context)!.licenses, - subtitle: AppLocalizations.of(context)!.licensesInfo, - screenToNavigate: const LicensesScreen(), - thisItem: 6, + ), + ]; + }, + body: SafeArea( + top: false, + bottom: false, + child: Builder( + builder: (context) => CustomScrollView( + slivers: [ + SliverOverlapInjector( + handle: NestedScrollView.sliverOverlapAbsorberHandleFor( + context, ), - Padding( - padding: const EdgeInsets.all(15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - IconButton( - onPressed: () => openUrl(Urls.playStore), - icon: SvgPicture.asset( - 'assets/resources/google-play.svg', - colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.onSurface, - BlendMode.srcIn, + ), + SliverList.list( + children: [ + SectionLabel( + label: AppLocalizations.of(context)!.appSettings, + ), + settingsTile( + icon: Icons.light_mode_rounded, + title: AppLocalizations.of(context)!.theme, + subtitle: getThemeString(), + thisItem: 0, + screenToNavigate: const ThemeScreen(), + ), + settingsTile( + icon: Icons.language, + title: AppLocalizations.of(context)!.language, + subtitle: getLanguageString(), + thisItem: 1, + screenToNavigate: const LanguageScreen(), + ), + settingsTile( + icon: Icons.storage_rounded, + title: AppLocalizations.of(context)!.servers, + subtitle: serversProvider.selectedServer != null + ? statusProvider.isServerConnected == true + ? '${AppLocalizations.of(context)!.connectedTo} ${serversProvider.selectedServer!.alias}' + : AppLocalizations.of(context)!.notConnectServer + : AppLocalizations.of(context)!.notSelected, + screenToNavigate: const ServersPage(), + thisItem: 2, + ), + settingsTile( + icon: Icons.update, + title: AppLocalizations.of(context)!.autoRefreshTime, + subtitle: + '${appConfigProvider.getAutoRefreshTime.toString()} ${AppLocalizations.of(context)!.seconds}', + thisItem: 3, + screenToNavigate: const AutoRefreshTimeScreen(), + ), + settingsTile( + icon: Icons.list_rounded, + title: + AppLocalizations.of(context)!.logsQuantityPerLoad, + subtitle: + '${appConfigProvider.logsPerQuery == 0.5 ? '30' : appConfigProvider.logsPerQuery.toInt()} ${appConfigProvider.logsPerQuery == 0.5 ? AppLocalizations.of(context)!.minutes : AppLocalizations.of(context)!.hours}', + thisItem: 4, + screenToNavigate: const LogsQuantityLoadScreen(), + ), + settingsTile( + icon: Icons.settings, + title: AppLocalizations.of(context)!.advancedSetup, + subtitle: AppLocalizations.of(context)! + .advancedSetupDescription, + screenToNavigate: const AdvancedOptions(), + thisItem: 5, + ), + SectionLabel( + label: AppLocalizations.of(context)!.about, + ), + CustomListTile( + label: AppLocalizations.of(context)!.applicationDetail, + description: AppLocalizations.of(context)!.aboutThisApp, + onTap: openAppDetailModal, + ), + CustomListTile( + label: AppLocalizations.of(context)!.privacy, + description: AppLocalizations.of(context)!.privacyInfo, + onTap: openPrivacyModal, + ), + CustomListTile( + label: + AppLocalizations.of(context)!.importantInformation, + description: AppLocalizations.of(context)!.readIssues, + onTap: openImportantInformationModal, + ), + CustomListTile( + label: AppLocalizations.of(context)!.legal, + description: AppLocalizations.of(context)!.legalInfo, + onTap: openLegalModal, + ), + settingsTile( + title: AppLocalizations.of(context)!.licenses, + subtitle: AppLocalizations.of(context)!.licensesInfo, + screenToNavigate: const LicensesScreen(), + thisItem: 6, + ), + Padding( + padding: const EdgeInsets.all(15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + IconButton( + onPressed: () => openUrl(Urls.playStore), + icon: SvgPicture.asset( + 'assets/resources/google-play.svg', + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.onSurface, + BlendMode.srcIn, + ), + width: 30, + height: 30, ), - width: 30, - height: 30, + tooltip: + AppLocalizations.of(context)!.visitGooglePlay, ), - tooltip: - AppLocalizations.of(context)!.visitGooglePlay, - ), - IconButton( - onPressed: () => openUrl(Urls.gitHub), - icon: SvgPicture.asset( - 'assets/resources/github.svg', - colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.onSurface, - BlendMode.srcIn, + IconButton( + onPressed: () => openUrl(Urls.gitHub), + icon: SvgPicture.asset( + 'assets/resources/github.svg', + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.onSurface, + BlendMode.srcIn, + ), + width: 30, + height: 30, ), - width: 30, - height: 30, + tooltip: AppLocalizations.of(context)!.gitHub, ), - tooltip: AppLocalizations.of(context)!.gitHub, - ), - ], + ], + ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), ), ), diff --git a/test/widgets/logs/logs_test.dart b/test/widgets/logs/logs_test.dart index fdece3ef..e9908f13 100644 --- a/test/widgets/logs/logs_test.dart +++ b/test/widgets/logs/logs_test.dart @@ -232,14 +232,15 @@ void main() async { expect(find.byType(Logs), findsOneWidget); await tester.pumpAndSettle(); expect(find.text('Query logs'), findsOneWidget); - expect(find.text('white.example.com'), findsOneWidget); + // expect(find.text('white.example.com'), findsOneWidget); why two widgets? + expect(find.text('white.example.com'), findsWidgets); expect( find.text('Choose a query log to see its details.'), findsOneWidget, ); // Tap whitelist domain to open domain detail screen - await tester.tap(find.text('white.example.com')); + await tester.tap(find.text('white.example.com').at(0)); await tester.pumpAndSettle(); expect(find.text('Log details'), findsOneWidget); diff --git a/test/widgets/servers/add_server_fullscreen_test.dart b/test/widgets/servers/add_server_fullscreen_test.dart index 95993145..ee0cec3e 100644 --- a/test/widgets/servers/add_server_fullscreen_test.dart +++ b/test/widgets/servers/add_server_fullscreen_test.dart @@ -9,7 +9,7 @@ import 'package:pi_hole_client/config/theme.dart'; import 'package:pi_hole_client/gateways/v5/api_gateway_v5.dart'; import 'package:pi_hole_client/models/app_log.dart'; import 'package:pi_hole_client/models/gateways.dart'; -import 'package:pi_hole_client/models/server.dart'; +// import 'package:pi_hole_client/models/server.dart'; import 'package:pi_hole_client/providers/servers_provider.dart'; import 'package:pi_hole_client/screens/servers/add_server_fullscreen.dart'; import 'package:provider/provider.dart'; @@ -31,12 +31,12 @@ void main() async { late MockServersProvider mockServersProvider; late MockApiGatewayV5 mockApiGatewayV5; - final server = Server( - address: 'http://localhost', - alias: 'v5', - defaultServer: false, - apiVersion: 'v5', - ); + // final server = Server( + // address: 'http://localhost', + // alias: 'v5', + // defaultServer: false, + // apiVersion: 'v5', + // ); setUp(() async { FlutterSecureStorage.setMockInitialValues({});