File tree 3 files changed +15
-1
lines changed
packages/scrollable_positioned_list
3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change
1
+ # 0.3.7
2
+ * Add ScrollOffsetListener to allow listening to changes in scroll offset.
3
+
1
4
# 0.3.6
2
5
* Fix cache extents for horizontal lists
3
6
* scrollTo future doesn't complete until scrolling is done.
Original file line number Diff line number Diff line change @@ -16,12 +16,14 @@ A `ScrollablePositionedList` can be created with:
16
16
``` dart
17
17
final ItemScrollController itemScrollController = ItemScrollController();
18
18
final ItemPositionsListener itemPositionsListener = ItemPositionsListener.create();
19
+ final ScrollOffsetListener scrollOffsetListener = ScrollOffsetListener.create()
19
20
20
21
ScrollablePositionedList.builder(
21
22
itemCount: 500,
22
23
itemBuilder: (context, index) => Text('Item $index'),
23
24
itemScrollController: itemScrollController,
24
25
itemPositionsListener: itemPositionsListener,
26
+ scrollOffsetListener: scrollOffsetListener,
25
27
);
26
28
```
27
29
@@ -46,6 +48,15 @@ One can monitor what items are visible on screen with:
46
48
itemPositionsListener.itemPositions.addListener(() => ...);
47
49
```
48
50
51
+ Changes in scroll position can be monitored with:
52
+
53
+ ``` dart
54
+ scrollOffsetListener.changes.listen((event) => ...)
55
+ ```
56
+
57
+ see ` ScrollSum ` in [ this test] ( test/scroll_offset_listener_test.dart ) for an example of how the current offset can be
58
+ calculated from the stream of scroll change deltas. This feature is new and experimental.
59
+
49
60
A full example can be found in the example folder.
50
61
51
62
--------------------------------------------------------------------------------
Original file line number Diff line number Diff line change 1
1
name : scrollable_positioned_list
2
- version : 0.3.6
2
+ version : 0.3.7
3
3
description : >
4
4
A list with helper methods to programmatically scroll to an item.
5
5
homepage : https://github.com/google/flutter.widgets/tree/master/packages/scrollable_positioned_list
You can’t perform that action at this time.
0 commit comments