From 39babdeeaaeff6a05d2d33fbfab810cd8dd71e65 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Wed, 24 Jul 2024 14:43:19 +0300 Subject: [PATCH] fix: Black bars on top of pages --- lib/ui/pages/more/console/console_page.dart | 44 +++--- .../binds_migration/services_migration.dart | 136 +++++++++--------- 2 files changed, 89 insertions(+), 91 deletions(-) diff --git a/lib/ui/pages/more/console/console_page.dart b/lib/ui/pages/more/console/console_page.dart index 6c549a70..9fa28325 100644 --- a/lib/ui/pages/more/console/console_page.dart +++ b/lib/ui/pages/more/console/console_page.dart @@ -44,30 +44,28 @@ class _ConsolePageState extends State { Widget build(final BuildContext context) { final List logs = console.logs; - return SafeArea( - child: Scaffold( - appBar: AppBar( - title: Text('console_page.title'.tr()), - leading: IconButton( - icon: const Icon(Icons.arrow_back), - onPressed: () => Navigator.of(context).maybePop(), - ), - actions: [ - IconButton( - icon: Icon( - console.paused - ? Icons.play_arrow_outlined - : Icons.pause_outlined, - ), - onPressed: console.paused ? console.play : console.pause, + return Scaffold( + appBar: AppBar( + title: Text('console_page.title'.tr()), + leading: IconButton( + icon: const Icon(Icons.arrow_back), + onPressed: () => Navigator.of(context).maybePop(), + ), + actions: [ + IconButton( + icon: Icon( + console.paused + ? Icons.play_arrow_outlined + : Icons.pause_outlined, ), - ], - ), - body: Scrollbar( - child: logs.isEmpty - ? const _ConsoleViewEmpty() - : _ConsoleViewLoaded(logs: logs), - ), + onPressed: console.paused ? console.play : console.pause, + ), + ], + ), + body: Scrollbar( + child: logs.isEmpty + ? const _ConsoleViewEmpty() + : _ConsoleViewLoaded(logs: logs), ), ); } diff --git a/lib/ui/pages/server_storage/binds_migration/services_migration.dart b/lib/ui/pages/server_storage/binds_migration/services_migration.dart index cc4d18aa..0c91161f 100644 --- a/lib/ui/pages/server_storage/binds_migration/services_migration.dart +++ b/lib/ui/pages/server_storage/binds_migration/services_migration.dart @@ -105,10 +105,10 @@ class _ServicesMigrationPageState extends State { listItemHeight * widget.diskStatus.diskVolumes.length + headerVerticalPadding * widget.diskStatus.diskVolumes.length, ); - return SafeArea( - child: Scaffold( - appBar: PreferredSize( - preferredSize: appBarHeight, + return Scaffold( + appBar: PreferredSize( + preferredSize: appBarHeight, + child: SafeArea( child: Column( children: [ BrandHeader( @@ -143,74 +143,74 @@ class _ServicesMigrationPageState extends State { ], ), ), - body: ListView( - padding: const EdgeInsets.all(16.0), - children: [ - if (widget.services.isEmpty) - const Center(child: CircularProgressIndicator.adaptive()), - ...widget.services.map( - (final service) => Column( - children: [ - const SizedBox(height: 8), - ServiceMigrationListItem( - service: service, - diskStatus: widget.diskStatus, - selectedVolume: serviceToDisk[service.id]!, - onChange: onChange, - ), - const SizedBox(height: 4), - const Divider(), - ], - ), + ), + body: ListView( + padding: const EdgeInsets.all(16.0), + children: [ + if (widget.services.isEmpty) + const Center(child: CircularProgressIndicator.adaptive()), + ...widget.services.map( + (final service) => Column( + children: [ + const SizedBox(height: 8), + ServiceMigrationListItem( + service: service, + diskStatus: widget.diskStatus, + selectedVolume: serviceToDisk[service.id]!, + onChange: onChange, + ), + const SizedBox(height: 4), + const Divider(), + ], ), - Padding( - padding: const EdgeInsets.all(8.0), - child: InfoBox( - text: 'storage.data_migration_notice'.tr(), - isWarning: true, - ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: InfoBox( + text: 'storage.data_migration_notice'.tr(), + isWarning: true, ), - const SizedBox(height: 16), - if (widget.isMigration || (!widget.isMigration && isVolumePicked)) - BrandButton.filled( - child: Text('storage.start_migration_button'.tr()), - onPressed: () { - if (widget.isMigration) { - context.read().migrateToBinds( - serviceToDisk, - ); - } else { - for (final service in widget.services) { - if (serviceToDisk[service.id] != null) { - context.read().add( - ServiceMove( - service, - serviceToDisk[service.id]!, - ), - ); - } + ), + const SizedBox(height: 16), + if (widget.isMigration || (!widget.isMigration && isVolumePicked)) + BrandButton.filled( + child: Text('storage.start_migration_button'.tr()), + onPressed: () { + if (widget.isMigration) { + context.read().migrateToBinds( + serviceToDisk, + ); + } else { + for (final service in widget.services) { + if (serviceToDisk[service.id] != null) { + context.read().add( + ServiceMove( + service, + serviceToDisk[service.id]!, + ), + ); } } - context.router.popUntilRoot(); - showModalBottomSheet( - context: context, - useRootNavigator: true, - isScrollControlled: true, - builder: (final BuildContext context) => - DraggableScrollableSheet( - expand: false, - maxChildSize: 0.9, - minChildSize: 0.4, - initialChildSize: 0.6, - builder: (final context, final scrollController) => - JobsContent(controller: scrollController), - ), - ); - }, - ), - const SizedBox(height: 32), - ], - ), + } + context.router.popUntilRoot(); + showModalBottomSheet( + context: context, + useRootNavigator: true, + isScrollControlled: true, + builder: (final BuildContext context) => + DraggableScrollableSheet( + expand: false, + maxChildSize: 0.9, + minChildSize: 0.4, + initialChildSize: 0.6, + builder: (final context, final scrollController) => + JobsContent(controller: scrollController), + ), + ); + }, + ), + const SizedBox(height: 32), + ], ), ); }