@@ -14,7 +14,6 @@ import 'package:immich_mobile/extensions/build_context_extensions.dart';
14
14
import 'package:immich_mobile/extensions/datetime_extensions.dart' ;
15
15
import 'package:immich_mobile/extensions/translate_extensions.dart' ;
16
16
import 'package:immich_mobile/presentation/widgets/images/image_provider.dart' ;
17
- import 'package:immich_mobile/providers/infrastructure/album.provider.dart' ;
18
17
import 'package:immich_mobile/providers/infrastructure/current_album.provider.dart' ;
19
18
import 'package:immich_mobile/providers/infrastructure/remote_album.provider.dart' ;
20
19
import 'package:immich_mobile/providers/infrastructure/timeline.provider.dart' ;
@@ -74,76 +73,75 @@ class _MesmerizingSliverAppBarState extends ConsumerState<RemoteAlbumSliverAppBa
74
73
const Shadow (offset: Offset (0 , 2 ), blurRadius: 0 , color: Colors .transparent),
75
74
];
76
75
77
- return isMultiSelectEnabled
78
- ? SliverToBoxAdapter (
79
- child: switch (_scrollProgress) {
80
- < 0.8 => const SizedBox (height: 120 ),
81
- _ => const SizedBox (height: 452 ),
82
- },
83
- )
84
- : SliverAppBar (
85
- expandedHeight: 400.0 ,
86
- floating: false ,
87
- pinned: true ,
88
- snap: false ,
89
- elevation: 0 ,
90
- leading: IconButton (
91
- icon: Icon (
92
- Platform .isIOS ? Icons .arrow_back_ios_new_rounded : Icons .arrow_back,
93
- color: actionIconColor,
94
- shadows: actionIconShadows,
95
- ),
96
- onPressed: () {
97
- ref.read (remoteAlbumProvider.notifier).refresh ();
98
- context.navigateTo (const TabShellRoute (children: [DriftAlbumsRoute ()]));
99
- },
76
+ if (isMultiSelectEnabled) {
77
+ return SliverToBoxAdapter (
78
+ child: switch (_scrollProgress) {
79
+ < 0.8 => const SizedBox (height: 120 ),
80
+ _ => const SizedBox (height: 452 ),
81
+ },
82
+ );
83
+ } else {
84
+ return SliverAppBar (
85
+ expandedHeight: 400.0 ,
86
+ floating: false ,
87
+ pinned: true ,
88
+ snap: false ,
89
+ elevation: 0 ,
90
+ leading: IconButton (
91
+ icon: Icon (
92
+ Platform .isIOS ? Icons .arrow_back_ios_new_rounded : Icons .arrow_back,
93
+ color: actionIconColor,
94
+ shadows: actionIconShadows,
95
+ ),
96
+ onPressed: () => context.navigateTo (const TabShellRoute (children: [DriftAlbumsRoute ()])),
97
+ ),
98
+ actions: [
99
+ if (widget.onToggleAlbumOrder != null )
100
+ IconButton (
101
+ icon: Icon (Icons .swap_vert_rounded, color: actionIconColor, shadows: actionIconShadows),
102
+ onPressed: widget.onToggleAlbumOrder,
100
103
),
101
- actions: [
102
- if (widget.onToggleAlbumOrder != null )
103
- IconButton (
104
- icon: Icon (Icons .swap_vert_rounded, color: actionIconColor, shadows: actionIconShadows),
105
- onPressed: widget.onToggleAlbumOrder,
106
- ),
107
- if (widget.onShowOptions != null )
108
- IconButton (
109
- icon: Icon (Icons .more_vert, color: actionIconColor, shadows: actionIconShadows),
110
- onPressed: widget.onShowOptions,
111
- ),
112
- ],
113
- flexibleSpace: Builder (
114
- builder: (context) {
115
- final settings = context.dependOnInheritedWidgetOfExactType <FlexibleSpaceBarSettings >();
116
- final scrollProgress = _calculateScrollProgress (settings);
117
-
118
- // Update scroll progress for the leading button
119
- WidgetsBinding .instance.addPostFrameCallback ((_) {
120
- if (mounted && _scrollProgress != scrollProgress) {
121
- setState (() {
122
- _scrollProgress = scrollProgress;
123
- });
124
- }
125
- });
126
-
127
- return FlexibleSpaceBar (
128
- centerTitle: true ,
129
- title: AnimatedSwitcher (
130
- duration: const Duration (milliseconds: 200 ),
131
- child: scrollProgress > 0.95
132
- ? Text (
133
- currentAlbum.name,
134
- style: TextStyle (color: context.primaryColor, fontWeight: FontWeight .w600, fontSize: 18 ),
135
- )
136
- : null ,
137
- ),
138
- background: _ExpandedBackground (
139
- scrollProgress: scrollProgress,
140
- icon: widget.icon,
141
- onEditTitle: widget.onEditTitle,
142
- ),
143
- );
144
- },
104
+ if (widget.onShowOptions != null )
105
+ IconButton (
106
+ icon: Icon (Icons .more_vert, color: actionIconColor, shadows: actionIconShadows),
107
+ onPressed: widget.onShowOptions,
145
108
),
146
- );
109
+ ],
110
+ flexibleSpace: Builder (
111
+ builder: (context) {
112
+ final settings = context.dependOnInheritedWidgetOfExactType <FlexibleSpaceBarSettings >();
113
+ final scrollProgress = _calculateScrollProgress (settings);
114
+
115
+ // Update scroll progress for the leading button
116
+ WidgetsBinding .instance.addPostFrameCallback ((_) {
117
+ if (mounted && _scrollProgress != scrollProgress) {
118
+ setState (() {
119
+ _scrollProgress = scrollProgress;
120
+ });
121
+ }
122
+ });
123
+
124
+ return FlexibleSpaceBar (
125
+ centerTitle: true ,
126
+ title: AnimatedSwitcher (
127
+ duration: const Duration (milliseconds: 200 ),
128
+ child: scrollProgress > 0.95
129
+ ? Text (
130
+ currentAlbum.name,
131
+ style: TextStyle (color: context.primaryColor, fontWeight: FontWeight .w600, fontSize: 18 ),
132
+ )
133
+ : null ,
134
+ ),
135
+ background: _ExpandedBackground (
136
+ scrollProgress: scrollProgress,
137
+ icon: widget.icon,
138
+ onEditTitle: widget.onEditTitle,
139
+ ),
140
+ );
141
+ },
142
+ ),
143
+ );
144
+ }
147
145
}
148
146
}
149
147
0 commit comments