avoid app bar color changes when scrolling

This commit is contained in:
Fabian Freund
2026-03-13 19:15:01 +01:00
parent 3262bb34b5
commit 9db5a3e79b
2 changed files with 17 additions and 4 deletions
@@ -111,11 +111,13 @@ class BrowserBottomAppBar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final bottomPadding = MediaQuery.of(context).padding.bottom; final bottomPadding = MediaQuery.of(context).padding.bottom;
final colorScheme = Theme.of(context).colorScheme;
return Material( return Material(
elevation: 3.0, elevation: 0,
surfaceTintColor: Theme.of(context).colorScheme.surfaceTint, shadowColor: Colors.transparent,
color: Theme.of(context).colorScheme.surfaceContainer, surfaceTintColor: Colors.transparent,
color: colorScheme.surfaceContainer,
child: Padding( child: Padding(
padding: EdgeInsets.only(bottom: bottomPadding), padding: EdgeInsets.only(bottom: bottomPadding),
child: SizedBox(height: _size.height, child: _tabBar), child: SizedBox(height: _size.height, child: _tabBar),
@@ -343,6 +345,8 @@ class BrowserTabBarView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
return GestureDetector( return GestureDetector(
// Tap handling moved to AppBarTitle for split icon/title behavior // Tap handling moved to AppBarTitle for split icon/title behavior
onHorizontalDragStart: onHorizontalDragStart, onHorizontalDragStart: onHorizontalDragStart,
@@ -365,10 +369,14 @@ class BrowserTabBarView extends StatelessWidget {
child: AppBar( child: AppBar(
primary: false, primary: false,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
backgroundColor:
backgroundColor ?? colorScheme.surfaceContainer,
scrolledUnderElevation: 0,
shadowColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
titleSpacing: 0.0, titleSpacing: 0.0,
leadingWidth: 40.0, leadingWidth: 40.0,
toolbarHeight: kToolbarHeight, toolbarHeight: kToolbarHeight,
backgroundColor: backgroundColor,
title: title, title: title,
actions: actions, actions: actions,
), ),
@@ -83,6 +83,7 @@ class SearchScreen extends HookConsumerWidget {
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final appColors = AppColors.of(context); final appColors = AppColors.of(context);
final colorScheme = Theme.of(context).colorScheme;
final formKey = useMemoized(() => GlobalKey<FormState>()); final formKey = useMemoized(() => GlobalKey<FormState>());
final createChildTabsOption = ref.watch( final createChildTabsOption = ref.watch(
@@ -454,6 +455,10 @@ class SearchScreen extends HookConsumerWidget {
floating: true, floating: true,
pinned: true, pinned: true,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
backgroundColor: colorScheme.surface,
scrolledUnderElevation: 0,
shadowColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
toolbarHeight: isEditMode ? 0 : kToolbarHeight, toolbarHeight: isEditMode ? 0 : kToolbarHeight,
titleSpacing: 0.0, titleSpacing: 0.0,
title: isEditMode title: isEditMode