NavBar optimieren #189

Merged
flixcoo merged 4 commits from enhancement/188-navbar-optimieren into development 2026-02-07 20:18:47 +00:00
8 changed files with 85 additions and 115 deletions

View File

@@ -13,13 +13,13 @@ class CustomTheme {
static const Color secondaryColor = Color(0xFFf2a981); static const Color secondaryColor = Color(0xFFf2a981);
/// Background color of the app theme /// Background color of the app theme
static const backgroundColor = Color(0xFF0B0B0B); static const Color backgroundColor = Color(0xFF0B0B0B);
Review

ich finde gut dass die farbe Bob heißt

ich finde gut dass die farbe Bob heißt
/// Default color for boxes and containers /// Default color for boxes and containers
static const Color boxColor = Color(0xFF101010); static const Color boxColor = Color(0xFF101010);
/// Default border color for boxes and containers /// Default border color for boxes and containers
static const Color boxBorder = Color(0xFF272727); static const Color boxBorderColor = Color(0xFF272727);
/// Color for boxes and containers displayed on boxes /// Color for boxes and containers displayed on boxes
static const Color onBoxColor = Color(0xFF181818); static const Color onBoxColor = Color(0xFF181818);
@@ -27,6 +27,9 @@ class CustomTheme {
/// Text color used throughout the app /// Text color used throughout the app
static const Color textColor = Color(0xFFFFFFFF); static const Color textColor = Color(0xFFFFFFFF);
/// Background color for the navigation bar
static const Color navBarBackgroundColor = Color(0xFF131313);
/// Selected color for the [NavbarItem] /// Selected color for the [NavbarItem]
static Color navBarItemSelectedColor = primaryColor.withGreen(100); static Color navBarItemSelectedColor = primaryColor.withGreen(100);
@@ -51,7 +54,7 @@ class CustomTheme {
// ==================== Decorations ==================== // ==================== Decorations ====================
static BoxDecoration standardBoxDecoration = BoxDecoration( static BoxDecoration standardBoxDecoration = BoxDecoration(
color: boxColor, color: boxColor,
border: Border.all(color: boxBorder), border: Border.all(color: boxBorderColor),
borderRadius: standardBorderRadiusAll, borderRadius: standardBorderRadiusAll,
); );

View File

@@ -1,5 +1,3 @@
import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:tallee/core/adaptive_page_route.dart'; import 'package:tallee/core/adaptive_page_route.dart';
import 'package:tallee/core/custom_theme.dart'; import 'package:tallee/core/custom_theme.dart';
@@ -75,66 +73,28 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
backgroundColor: CustomTheme.backgroundColor, backgroundColor: CustomTheme.backgroundColor,
body: tabs[currentIndex], body: tabs[currentIndex],
extendBody: true, extendBody: true,
bottomNavigationBar: SizedBox( bottomNavigationBar: Container(
height: 70 + MediaQuery.of(context).padding.bottom, height: 115,
child: Stack(
children: [
// Dynamically generated blur layers for ultra-smooth transition
...List.generate(34, (index) {
// Use cubic curve for an even more natural, smoother transition
final progress = index / 34.0; // 0.0 to 1.0
final cubic = progress * progress * progress; // cubic curve
final blurStrength =
0.5 + (cubic * 50.0); // Very smooth from 0.5 to 50.5
// Height goes completely from 100% to 0% (all the way down)
// With extra density at the bottom for softer transition
final heightFactor = index < 25
// First 25 layers: 100% to 30%
? 1.0 - (progress * 0.7)
// Last 10 layers: 30% to 0% (denser)
: 0.3 - ((index - 25) / 34.0);
return Positioned(
left: 0,
right: 0,
bottom: 0,
height:
(70 + MediaQuery.of(context).padding.bottom) *
heightFactor.clamp(0.05, 1.0),
child: ClipRect(
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: blurStrength,
sigmaY: blurStrength,
),
child: Container(color: Colors.transparent),
),
),
);
}),
// Gradient overlay
Positioned.fill(
child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( color: CustomTheme.navBarBackgroundColor,
begin: Alignment.bottomCenter, border: Border.all(
end: Alignment.topCenter, strokeAlign: BorderSide.strokeAlignOutside,
colors: [ color: CustomTheme.boxBorderColor,
CustomTheme.boxColor.withValues(alpha: 1), width: 2,
CustomTheme.boxColor.withValues(alpha: 0.5), ),
CustomTheme.boxColor.withValues(alpha: 0.2), borderRadius: const BorderRadius.only(
CustomTheme.boxColor.withValues(alpha: 0.0), topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.1),
blurRadius: 20,
offset: const Offset(0, -5),
),
], ],
stops: const [0.0, 0.4, 0.8, 1],
), ),
), child: SafeArea(
),
),
// Navbar content
SafeArea(
child: SizedBox(
height: 70,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
@@ -170,9 +130,6 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
), ),
), ),
), ),
],
),
),
); );
} }

View File

@@ -74,7 +74,7 @@ class _MatchResultViewState extends State<MatchResultView> {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: CustomTheme.boxColor, color: CustomTheme.boxColor,
border: Border.all(color: CustomTheme.boxBorder), border: Border.all(color: CustomTheme.boxBorderColor),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
child: Column( child: Column(

View File

@@ -32,7 +32,7 @@ class CustomAlertDialog extends StatelessWidget {
actionsAlignment: MainAxisAlignment.spaceAround, actionsAlignment: MainAxisAlignment.spaceAround,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: CustomTheme.standardBorderRadiusAll, borderRadius: CustomTheme.standardBorderRadiusAll,
side: const BorderSide(color: CustomTheme.boxBorder), side: const BorderSide(color: CustomTheme.boxBorderColor),
), ),
); );
} }

View File

@@ -87,7 +87,17 @@ class _NavbarItemState extends State<NavbarItem>
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
ScaleTransition( AnimatedContainer(
width: 50,
height: 50,
decoration: BoxDecoration(
color: widget.isSelected
? CustomTheme.primaryColor.withAlpha(50)
: Colors.transparent,
borderRadius: const BorderRadius.all(Radius.circular(15)),
),
duration: const Duration(milliseconds: 200),
child: ScaleTransition(
scale: widget.isSelected scale: widget.isSelected
? _scaleAnimation ? _scaleAnimation
: const AlwaysStoppedAnimation(1.0), : const AlwaysStoppedAnimation(1.0),
@@ -99,7 +109,7 @@ class _NavbarItemState extends State<NavbarItem>
size: 32, size: 32,
), ),
), ),
const SizedBox(height: 4), ),
Text( Text(
widget.label, widget.label,
style: TextStyle( style: TextStyle(

View File

@@ -88,7 +88,7 @@ class CustomSearchBar extends StatelessWidget {
], ],
backgroundColor: WidgetStateProperty.all(CustomTheme.boxColor), backgroundColor: WidgetStateProperty.all(CustomTheme.boxColor),
side: WidgetStateProperty.all( side: WidgetStateProperty.all(
const BorderSide(color: CustomTheme.boxBorder), const BorderSide(color: CustomTheme.boxBorderColor),
), ),
shape: WidgetStateProperty.all( shape: WidgetStateProperty.all(
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),

View File

@@ -44,11 +44,11 @@ class TextInputField extends StatelessWidget {
counterText: '', counterText: '',
enabledBorder: const OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(12)), borderRadius: BorderRadius.all(Radius.circular(12)),
borderSide: BorderSide(color: CustomTheme.boxBorder), borderSide: BorderSide(color: CustomTheme.boxBorderColor),
), ),
focusedBorder: const OutlineInputBorder( focusedBorder: const OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(12)), borderRadius: BorderRadius.all(Radius.circular(12)),
borderSide: BorderSide(color: CustomTheme.boxBorder), borderSide: BorderSide(color: CustomTheme.boxBorderColor),
), ),
floatingLabelBehavior: FloatingLabelBehavior.never, floatingLabelBehavior: FloatingLabelBehavior.never,
), ),

View File

@@ -31,7 +31,7 @@ class CustomRadioListTile<T> extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 2), padding: const EdgeInsets.symmetric(horizontal: 2),
decoration: BoxDecoration( decoration: BoxDecoration(
color: CustomTheme.boxColor, color: CustomTheme.boxColor,
border: Border.all(color: CustomTheme.boxBorder), border: Border.all(color: CustomTheme.boxBorderColor),
borderRadius: CustomTheme.standardBorderRadiusAll, borderRadius: CustomTheme.standardBorderRadiusAll,
), ),
child: Row( child: Row(