chore: Cleaned up side_navigaton_bar

This commit is contained in:
PartyDonut 2025-07-31 18:14:19 +02:00
parent bfa7607681
commit fefd2d9ad9

View file

@ -72,13 +72,11 @@ class _SideNavigationBarState extends ConsumerState<SideNavigationBar> {
color: Theme.of(context).colorScheme.surface.withValues(alpha: shouldExpand ? 0.95 : 0.85), color: Theme.of(context).colorScheme.surface.withValues(alpha: shouldExpand ? 0.95 : 0.85),
width: shouldExpand ? expandedWidth : collapsedWidth, width: shouldExpand ? expandedWidth : collapsedWidth,
child: MouseRegion( child: MouseRegion(
child: Column(
children: [
Expanded(
child: Padding( child: Padding(
key: const Key('navigation_rail'), key: const Key('navigation_rail'),
padding: padding.copyWith(right: 0, top: isDesktop ? padding.top : null), padding: padding.copyWith(right: 0, top: isDesktop ? padding.top : null),
child: Column( child: Column(
spacing: 2,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 14), padding: const EdgeInsets.symmetric(horizontal: 14),
@ -95,9 +93,7 @@ class _SideNavigationBarState extends ConsumerState<SideNavigationBar> {
? () => widget.scaffoldKey.currentState?.openDrawer() ? () => widget.scaffoldKey.currentState?.openDrawer()
: () => setState(() => expandedSideBar = !expandedSideBar), : () => setState(() => expandedSideBar = !expandedSideBar),
icon: Icon( icon: Icon(
largeBar && expandedSideBar largeBar && expandedSideBar ? IconsaxPlusLinear.sidebar_left : IconsaxPlusLinear.menu,
? IconsaxPlusLinear.sidebar_left
: IconsaxPlusLinear.menu,
), ),
), ),
) )
@ -112,10 +108,8 @@ class _SideNavigationBarState extends ConsumerState<SideNavigationBar> {
], ],
Expanded( Expanded(
child: Column( child: Column(
spacing: 2,
mainAxisAlignment: !largeBar ? MainAxisAlignment.center : MainAxisAlignment.start, mainAxisAlignment: !largeBar ? MainAxisAlignment.center : MainAxisAlignment.start,
children: [ children: [
const SizedBox(height: 8),
...widget.destinations.mapIndexed( ...widget.destinations.mapIndexed(
(index, destination) => CustomTooltip( (index, destination) => CustomTooltip(
tooltipContent: expandedSideBar tooltipContent: expandedSideBar
@ -298,15 +292,12 @@ class _SideNavigationBarState extends ConsumerState<SideNavigationBar> {
} }
}, },
), ),
],
),
),
),
if (AdaptiveLayout.of(context).inputDevice == InputDevice.pointer) const SizedBox(height: 16), if (AdaptiveLayout.of(context).inputDevice == InputDevice.pointer) const SizedBox(height: 16),
], ],
), ),
), ),
), ),
),
], ],
); );
} }