Refactor HomePage layout to center title and align navigation buttons, enhancing visual structure

This commit is contained in:
Leon Bösche
2026-01-17 01:58:27 +01:00
parent a219b8c1a2
commit 712abbb34f

View File

@@ -405,42 +405,43 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
backgroundColor: AppTheme.primaryBackground, backgroundColor: AppTheme.primaryBackground,
body: Stack( body: Stack(
children: [ children: [
// Top bar: title and nav buttons // Top bar: title always centered, nav buttons right
Positioned( Positioned(
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 32), padding: const EdgeInsets.symmetric(horizontal: 32),
child: Row( child: SizedBox(
crossAxisAlignment: CrossAxisAlignment.center, height: 64,
children: [ child: Stack(
// Left spacer alignment: Alignment.center,
const Expanded(child: SizedBox()), children: [
// Center: title only // Centered title
Expanded( Align(
flex: 2, alignment: Alignment.center,
child: Builder( child: Builder(
builder: (context) { builder: (context) {
final screenWidth = MediaQuery.of(context).size.width; final screenWidth = MediaQuery.of(
final fontSize = screenWidth < 600 ? 24.0 : 48.0; context,
return Text( ).size.width;
'b0esche.cloud', final fontSize = screenWidth < 600 ? 24.0 : 48.0;
style: TextStyle( return Text(
fontFamily: 'PixelatedElegance', 'b0esche.cloud',
fontSize: fontSize, style: TextStyle(
color: AppTheme.primaryText, fontFamily: 'PixelatedElegance',
decoration: TextDecoration.underline, fontSize: fontSize,
decorationColor: AppTheme.primaryText, color: AppTheme.primaryText,
fontFeatures: const [FontFeature.slashedZero()], decoration: TextDecoration.underline,
), decorationColor: AppTheme.primaryText,
); fontFeatures: const [FontFeature.slashedZero()],
}, ),
);
},
),
), ),
), // Right: nav buttons
// Right: nav buttons Align(
Expanded(
child: Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: BlocBuilder<AuthBloc, AuthState>( child: BlocBuilder<AuthBloc, AuthState>(
builder: (context, state) { builder: (context, state) {
@@ -467,8 +468,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
}, },
), ),
), ),
), ],
], ),
), ),
), ),
), ),