diff --git a/lib/screens/home/combined_chart.dart b/lib/screens/home/combined_chart.dart index f7080ab..9bd9d36 100644 --- a/lib/screens/home/combined_chart.dart +++ b/lib/screens/home/combined_chart.dart @@ -149,7 +149,7 @@ class CombinedHomeChart extends StatelessWidget { ); } - if (width > 900) { + if (width > 700) { return Column( children: [ Text( @@ -213,7 +213,12 @@ class CombinedHomeChart extends StatelessWidget { ) ), ], - ) + ), + Divider( + thickness: 1, + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.2), + ), + const SizedBox(height: 16) ], ); } diff --git a/lib/screens/home/home.dart b/lib/screens/home/home.dart index f6bd07d..9626130 100644 --- a/lib/screens/home/home.dart +++ b/lib/screens/home/home.dart @@ -208,7 +208,6 @@ class _HomeState extends State { ], if (width > 700) Column( children: [ - const SizedBox(height: 16), Wrap( alignment: WrapAlignment.center, children: [ @@ -259,68 +258,71 @@ class _HomeState extends State { } return Scaffold( - body: Stack( - children: [ - NestedScrollView( - controller: scrollController, - headerSliverBuilder: (context, innerBoxIsScrolled) => [ - SliverOverlapAbsorber( - handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), - sliver: HomeAppBar(innerBoxScrolled: innerBoxIsScrolled,) + body: SafeArea( + top: false, + child: Stack( + children: [ + NestedScrollView( + controller: scrollController, + headerSliverBuilder: (context, innerBoxIsScrolled) => [ + SliverOverlapAbsorber( + handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), + sliver: HomeAppBar(innerBoxScrolled: innerBoxIsScrolled,) + ) + ], + body: SafeArea( + top: false, + bottom: false, + child: Builder( + builder: (context) => RefreshIndicator( + color: Theme.of(context).colorScheme.primary, + onRefresh: () async { + final result = await getServerStatus(serversProvider.selectedServer!); + if (result['result'] == 'success') { + serversProvider.setServerStatusData(result['data']); + } + else { + appConfigProvider.addLog(result['log']); + showSnacbkar( + appConfigProvider: appConfigProvider, + label: AppLocalizations.of(context)!.serverStatusNotRefreshed, + color: Colors.red + ); + } + }, + child: CustomScrollView( + slivers: [ + SliverOverlapInjector( + handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), + ), + if (serversProvider.serverStatus.loadStatus == 0) SliverFillRemaining( + child: loading(), + ), + if (serversProvider.serverStatus.loadStatus == 1) SliverList.list( + children: listItems() + ), + if (serversProvider.serverStatus.loadStatus == 2) SliverFillRemaining( + child: loadError(), + ), + ], + ) + ), + ) ) - ], - body: SafeArea( - top: false, - bottom: false, - child: Builder( - builder: (context) => RefreshIndicator( - color: Theme.of(context).colorScheme.primary, - onRefresh: () async { - final result = await getServerStatus(serversProvider.selectedServer!); - if (result['result'] == 'success') { - serversProvider.setServerStatusData(result['data']); - } - else { - appConfigProvider.addLog(result['log']); - showSnacbkar( - appConfigProvider: appConfigProvider, - label: AppLocalizations.of(context)!.serverStatusNotRefreshed, - color: Colors.red - ); - } - }, - child: CustomScrollView( - slivers: [ - SliverOverlapInjector( - handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), - ), - if (serversProvider.serverStatus.loadStatus == 0) SliverFillRemaining( - child: loading(), - ), - if (serversProvider.serverStatus.loadStatus == 1) SliverList.list( - children: listItems() - ), - if (serversProvider.serverStatus.loadStatus == 2) SliverFillRemaining( - child: loadError(), - ), - ], - ) - ), - ) - ) - ), - AnimatedPositioned( - duration: const Duration(milliseconds: 100), - curve: Curves.easeInOut, - bottom: isVisible == true ? - appConfigProvider.showingSnackbar - ? 70 - : 20 - : -70, - right: 20, - child: const HomeFab() - ), - ], + ), + AnimatedPositioned( + duration: const Duration(milliseconds: 100), + curve: Curves.easeInOut, + bottom: isVisible == true ? + appConfigProvider.showingSnackbar + ? 70 + : 20 + : -70, + right: 20, + child: const HomeFab() + ), + ], + ), ), ); } diff --git a/lib/screens/home/server_status.dart b/lib/screens/home/server_status.dart index 3cc7656..2a52889 100644 --- a/lib/screens/home/server_status.dart +++ b/lib/screens/home/server_status.dart @@ -21,22 +21,19 @@ class ServerStatus extends StatelessWidget { padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16), child: Column( children: [ - Padding( - padding: width > 700 - ? const EdgeInsets.all(16) - : const EdgeInsets.all(0), - child: Text( - AppLocalizations.of(context)!.serverStatus, - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.w500, - color: Theme.of(context).colorScheme.onSurface - ), + Text( + AppLocalizations.of(context)!.serverStatus, + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w500, + color: Theme.of(context).colorScheme.onSurface ), ), + const SizedBox(height: 16), SizedBox( - height: width > 700 ? 70 : 170, + height: width > 700 ? 66 : 146, child: GridView( + padding: const EdgeInsets.all(0), physics: const NeverScrollableScrollPhysics(), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: width > 700 ? 4 : 2,