Commit f2be126
authored
Added SliverFloatingHeader.snapMode (#151289)
When a user scroll gesture ends, Material Design floating headers snap into place by animating as far as needed and overlaying the underlying scrollable content. For example Gmail's search header works this way. Other apps handle the snap animation by scrolling content out of the way. Instagram for example.
Added `SliverFloatingHeader.snapMode`, whose value can be `FloatingHeaderSnapMode.overlay` (the default) or `FloatingHeaderSnapMode.scroll`, so that developers can choose the snap animation style they want.
| FloatingHeaderSnapMode.overlay | FloatingHeaderSnapMode.scroll |
| --- | --- |
| <video src="https://github.com/flutter/flutter/assets/1377460/05c82ddf-05a6-4431-9b1e-88b901feea68" /> | <video src="https://github.com/flutter/flutter/assets/1377460/fedc34de-0b55-4f0d-976f-2df1965c90bc" /> |1 parent b713445 commit f2be126
File tree
2 files changed
+129
-2
lines changed- packages/flutter
- lib/src/widgets
- test/widgets
2 files changed
+129
-2
lines changedLines changed: 41 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
16 | 36 | | |
17 | 37 | | |
18 | 38 | | |
| |||
42 | 62 | | |
43 | 63 | | |
44 | 64 | | |
| 65 | + | |
45 | 66 | | |
46 | 67 | | |
47 | 68 | | |
| |||
51 | 72 | | |
52 | 73 | | |
53 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
54 | 82 | | |
55 | 83 | | |
56 | 84 | | |
| |||
66 | 94 | | |
67 | 95 | | |
68 | 96 | | |
| 97 | + | |
69 | 98 | | |
70 | 99 | | |
71 | 100 | | |
| |||
118 | 147 | | |
119 | 148 | | |
120 | 149 | | |
| 150 | + | |
121 | 151 | | |
122 | 152 | | |
123 | 153 | | |
124 | 154 | | |
125 | 155 | | |
| 156 | + | |
126 | 157 | | |
127 | 158 | | |
128 | 159 | | |
129 | 160 | | |
130 | 161 | | |
131 | 162 | | |
| 163 | + | |
132 | 164 | | |
133 | 165 | | |
134 | 166 | | |
135 | 167 | | |
136 | 168 | | |
137 | 169 | | |
138 | 170 | | |
139 | | - | |
| 171 | + | |
| 172 | + | |
140 | 173 | | |
141 | 174 | | |
142 | 175 | | |
143 | 176 | | |
144 | 177 | | |
145 | 178 | | |
146 | 179 | | |
| 180 | + | |
147 | 181 | | |
148 | 182 | | |
149 | 183 | | |
| |||
173 | 207 | | |
174 | 208 | | |
175 | 209 | | |
| 210 | + | |
| 211 | + | |
176 | 212 | | |
177 | 213 | | |
178 | 214 | | |
| |||
265 | 301 | | |
266 | 302 | | |
267 | 303 | | |
268 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
269 | 308 | | |
270 | 309 | | |
271 | 310 | | |
| |||
Lines changed: 88 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
237 | 325 | | |
0 commit comments