@@ -2,6 +2,7 @@ import 'package:flutter/gestures.dart';
2
2
import 'package:flutter/material.dart' ;
3
3
import 'package:flutter/rendering.dart' ;
4
4
import 'package:flutter_hooks/flutter_hooks.dart' ;
5
+ import 'package:flutter_module/generated/assets.dart' ;
5
6
import 'package:flutter_module/model/main_model.dart' ;
6
7
import 'package:flutter_module/presentation/navigation/details/details_navigator.dart' ;
7
8
import 'package:flutter_module/presentation/navigation/login/login_navigator.dart' ;
@@ -99,7 +100,10 @@ class _MainPage extends HookWidget {
99
100
onPressed: () => model.loadNextPage (),
100
101
tooltip: 'Scroll to top' ,
101
102
backgroundColor: ColorStyles .surfacePrimary (),
102
- child: const Icon (Icons .arrow_upward_outlined, color: Colors .black,),
103
+ child: const Icon (
104
+ Icons .arrow_upward_outlined,
105
+ color: Colors .black,
106
+ ),
103
107
),
104
108
);
105
109
}
@@ -124,8 +128,13 @@ class _MainPageData extends HookWidget {
124
128
headerSliverBuilder: (_, __) {
125
129
return [
126
130
SliverAppBar (
131
+ elevation: 0.0 ,
127
132
centerTitle: true ,
128
- title: TextStyles .appBarLogo ('SnipMe' ),
133
+ title: Row (mainAxisSize: MainAxisSize .min, children: [
134
+ Image .asset (Assets .appLogo, width: 18.0 ),
135
+ const SizedBox (width: Dimens .m),
136
+ TextStyles .appBarLogo ('SnipMe' ),
137
+ ]),
129
138
backgroundColor: ColorStyles .surfacePrimary (),
130
139
leading: IconButton (
131
140
icon: const Icon (Icons .logout),
@@ -145,18 +154,20 @@ class _MainPageData extends HookWidget {
145
154
SliverAppBar (
146
155
floating: true ,
147
156
expandedHeight: 120 ,
148
- shape: RoundedRectangleBorder (
157
+ elevation: Dimens .m,
158
+ backgroundColor: ColorStyles .surfacePrimary (),
159
+ shape: const RoundedRectangleBorder (
149
160
borderRadius: BorderRadius .only (
150
- bottomLeft: Radius .circular (Dimens .m ),
151
- bottomRight: Radius .circular (Dimens .m ),
161
+ bottomLeft: Radius .circular (Dimens .l ),
162
+ bottomRight: Radius .circular (Dimens .l ),
152
163
),
153
164
),
154
165
flexibleSpace: FlexibleSpaceBar (
155
166
collapseMode: CollapseMode .parallax,
156
167
background: Column (
157
168
mainAxisAlignment: MainAxisAlignment .center,
158
169
children: [
159
- Row (children: [Text ("Language" )]),
170
+ Row (children: [const Text ("Language" )]),
160
171
SizedBox (
161
172
height: 64 ,
162
173
child: FilterListView (
@@ -170,7 +181,9 @@ class _MainPageData extends HookWidget {
170
181
];
171
182
},
172
183
body: CustomScrollView (
173
- // scrollBehavior: const ConstantScrollBehavior(),
184
+ scrollBehavior: const ScrollBehavior (
185
+ androidOverscrollIndicator: AndroidOverscrollIndicator .stretch,
186
+ ),
174
187
slivers: [
175
188
SliverList (
176
189
delegate: SliverChildListDelegate ([
@@ -197,61 +210,3 @@ class _MainPageData extends HookWidget {
197
210
);
198
211
}
199
212
}
200
-
201
- class MySliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate {
202
- final Widget child;
203
-
204
- MySliverPersistentHeaderDelegate ({required this .child});
205
-
206
- @override
207
- Widget build (
208
- BuildContext context, double shrinkOffset, bool overlapsContent) {
209
- print ("Offset: $shrinkOffset " );
210
-
211
- return OverflowBox (
212
- maxWidth: double .infinity,
213
- alignment: Alignment .center,
214
- maxHeight: 150 - shrinkOffset,
215
- child: FittedBox (
216
- fit: BoxFit .cover,
217
- alignment: Alignment .center,
218
- child: Container (color: Colors .red, child: child),
219
- ),
220
- );
221
- }
222
-
223
- @override
224
- double get maxExtent => 150.0 ;
225
-
226
- @override
227
- double get minExtent => 50.0 ;
228
-
229
- @override
230
- bool shouldRebuild (covariant SliverPersistentHeaderDelegate oldDelegate) {
231
- return true ;
232
- }
233
- }
234
-
235
- class MyRenderSliverFloatingPersistentHeader
236
- extends RenderSliverFloatingPinnedPersistentHeader {
237
- MyRenderSliverFloatingPersistentHeader ({
238
- required super .child,
239
- });
240
-
241
- @override
242
- double get maxExtent => 250.0 ;
243
-
244
- @override
245
- double get minExtent => 100.0 ;
246
- }
247
-
248
- // Column(
249
- // children: [
250
- // Text("Language"),
251
- // FilterListView(
252
- // filters: ['a', 'b'],
253
- // selected: ['a'],
254
- // ),
255
- // Text("Language"),
256
- // ],
257
- // ),
0 commit comments