Refactor HomePage layout for improved audio player visibility and navigation button arrangement

This commit is contained in:
Leon Bösche
2026-01-17 01:23:39 +01:00
parent c6eb497bfa
commit c2919facfd

View File

@@ -405,7 +405,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
backgroundColor: AppTheme.primaryBackground,
body: Stack(
children: [
// Title and audio bar row
// Top bar: title, audio bar (if visible), nav buttons, all in a centered row
Positioned(
top: 0,
left: 0,
@@ -416,7 +416,9 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
left: 32,
right: 32,
),
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// Title
@@ -437,18 +439,13 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
);
},
),
const SizedBox(width: 32),
// Audio bar (centered between title and nav buttons)
Expanded(
child: AnimatedBuilder(
animation: _audioBarController,
builder: (context, child) {
return (_showAudioBar &&
// Audio player (if visible)
if (_showAudioBar &&
_audioFileName != null &&
_audioFileUrl != null)
? Center(
child: FractionallySizedBox(
widthFactor: 0.7,
_audioFileUrl != null) ...[
const SizedBox(width: 32),
FractionallySizedBox(
widthFactor: 0.5,
child: SlideTransition(
position: _audioBarOffset,
child: AudioPlayerBar(
@@ -461,13 +458,9 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
),
),
),
)
: const SizedBox.shrink();
},
),
),
],
const SizedBox(width: 32),
// Navigation buttons (Drive, Mail, Add, Profile)
// Navigation buttons
BlocBuilder<AuthBloc, AuthState>(
builder: (context, state) {
final isLoggedIn = state is AuthAuthenticated;
@@ -496,6 +489,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
),
),
),
),
Center(
child: BlocBuilder<AuthBloc, AuthState>(
builder: (context, state) {