From 2c565c3b50738153942b234d81272a0e2884cf04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Sat, 17 Jan 2026 01:41:58 +0100 Subject: [PATCH] Refactor HomePage layout to improve audio bar integration and navigation button arrangement --- b0esche_cloud/lib/pages/home_page.dart | 148 +++++++++++++------------ 1 file changed, 80 insertions(+), 68 deletions(-) diff --git a/b0esche_cloud/lib/pages/home_page.dart b/b0esche_cloud/lib/pages/home_page.dart index b467c94..6024283 100644 --- a/b0esche_cloud/lib/pages/home_page.dart +++ b/b0esche_cloud/lib/pages/home_page.dart @@ -412,77 +412,89 @@ class _HomePageState extends State with TickerProviderStateMixin { right: 0, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 32), - child: Center( - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // Title - Builder( - builder: (context) { - final screenWidth = MediaQuery.of(context).size.width; - final fontSize = screenWidth < 600 ? 24.0 : 48.0; - return Text( - 'b0esche.cloud', - style: TextStyle( - fontFamily: 'PixelatedElegance', - fontSize: fontSize, - color: AppTheme.primaryText, - decoration: TextDecoration.underline, - decorationColor: AppTheme.primaryText, - fontFeatures: const [FontFeature.slashedZero()], - ), - ); - }, - ), - // Audio player (if visible) - if (_showAudioBar && - _audioFileName != null && - _audioFileUrl != null) ...[ - const SizedBox(width: 32), - FractionallySizedBox( - widthFactor: 0.5, - child: SlideTransition( - position: _audioBarOffset, - child: AudioPlayerBar( - fileName: _audioFileName!, - fileUrl: _audioFileUrl!, - onClose: () { - _audioBarController.reverse(); - setState(() => _showAudioBar = false); - }, - ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // Left spacer + const Expanded(child: SizedBox()), + // Center: title and audio bar + Expanded( + flex: 2, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Builder( + builder: (context) { + final screenWidth = MediaQuery.of( + context, + ).size.width; + final fontSize = screenWidth < 600 ? 24.0 : 48.0; + return Text( + 'b0esche.cloud', + style: TextStyle( + fontFamily: 'PixelatedElegance', + fontSize: fontSize, + color: AppTheme.primaryText, + decoration: TextDecoration.underline, + decorationColor: AppTheme.primaryText, + fontFeatures: const [ + FontFeature.slashedZero(), + ], + ), + ); + }, ), - ), - ], - const SizedBox(width: 32), - // Navigation buttons - BlocBuilder( - builder: (context, state) { - final isLoggedIn = state is AuthAuthenticated; - if (!isLoggedIn) { - return const SizedBox.shrink(); - } - return Row( - mainAxisSize: MainAxisSize.min, - children: [ - _buildNavButton('Drive', Icons.cloud), - const SizedBox(width: 16), - _buildNavButton('Mail', Icons.mail), - const SizedBox(width: 16), - _buildNavButton('Add', Icons.add), - const SizedBox(width: 16), - _buildNavButton( - 'Profile', - Icons.person, - isAvatar: true, + if (_showAudioBar && + _audioFileName != null && + _audioFileUrl != null) ...[ + const SizedBox(width: 24), + SlideTransition( + position: _audioBarOffset, + child: AudioPlayerBar( + fileName: _audioFileName!, + fileUrl: _audioFileUrl!, + onClose: () { + _audioBarController.reverse(); + setState(() => _showAudioBar = false); + }, ), - ], - ); - }, + ), + ], + ], ), - ], - ), + ), + // Right: nav buttons + Expanded( + child: Align( + alignment: Alignment.centerRight, + child: BlocBuilder( + builder: (context, state) { + final isLoggedIn = state is AuthAuthenticated; + if (!isLoggedIn) { + return const SizedBox.shrink(); + } + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + _buildNavButton('Drive', Icons.cloud), + const SizedBox(width: 16), + _buildNavButton('Mail', Icons.mail), + const SizedBox(width: 16), + _buildNavButton('Add', Icons.add), + const SizedBox(width: 16), + _buildNavButton( + 'Profile', + Icons.person, + isAvatar: true, + ), + ], + ); + }, + ), + ), + ), + ], ), ), ),