Parcourir la source

misc changes in TitleBarWidget

ashilkn il y a 2 ans
Parent
commit
b098208b38
1 fichiers modifiés avec 5 ajouts et 2 suppressions
  1. 5 2
      lib/ui/components/title_bar_widget.dart

+ 5 - 2
lib/ui/components/title_bar_widget.dart

@@ -11,6 +11,7 @@ class TitleBarWidget extends StatelessWidget {
   final List<Widget>? actionIcons;
   final bool isTitleH2WithoutLeading;
   final bool isFlexibleSpaceDisabled;
+  final bool isOnTopOfScreen;
   const TitleBarWidget({
     this.leading,
     this.title,
@@ -20,6 +21,7 @@ class TitleBarWidget extends StatelessWidget {
     this.actionIcons,
     this.isTitleH2WithoutLeading = false,
     this.isFlexibleSpaceDisabled = false,
+    this.isOnTopOfScreen = true,
     super.key,
   });
 
@@ -29,13 +31,14 @@ class TitleBarWidget extends StatelessWidget {
     final textTheme = getEnteTextTheme(context);
     final colorTheme = getEnteColorScheme(context);
     return SliverAppBar(
+      primary: isOnTopOfScreen ? true : false,
       toolbarHeight: toolbarHeight,
       leadingWidth: 48,
       automaticallyImplyLeading: false,
       pinned: true,
-      expandedHeight: 102,
+      expandedHeight: isFlexibleSpaceDisabled ? toolbarHeight : 102,
       centerTitle: false,
-      titleSpacing: 0,
+      titleSpacing: 4,
       title: Padding(
         padding: EdgeInsets.only(left: isTitleH2WithoutLeading ? 16 : 0),
         child: Column(