Skip to content

Commit b85e6d3

Browse files
Merge pull request #44 from wisemen-digital/PagedList-change
Added invisibleItemsThreshold to constructor
2 parents 6107b3e + bd3432f commit b85e6d3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/wisewidgetslibrary/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.1.2
2+
3+
* Added invisibleItemsThreshold to the PagedList constructor
4+
15
## 2.1.1
26

37
- Dependency update

packages/wisewidgetslibrary/lib/src/widgets/paged_list.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class PagedList<T> extends StatelessWidget {
2424
this.animationInterval = 200,
2525
this.shimmerColor,
2626
this.shimmerHighlightColor,
27+
this.invisibleItemsThreshold = 5,
2728
});
2829

2930
/// List of items to display, usually a stream from database
@@ -72,6 +73,9 @@ class PagedList<T> extends StatelessWidget {
7273
/// Optional shimmer highlight color for the loading indicator
7374
final Color? shimmerHighlightColor;
7475

76+
/// The threshold for the number of invisible items to trigger fetching more data.
77+
final int invisibleItemsThreshold;
78+
7579
@override
7680
Widget build(BuildContext context) {
7781
return ValueListenableBuilder(
@@ -105,7 +109,7 @@ class PagedList<T> extends StatelessWidget {
105109
loadMoreErrorBuilder: (context, onRetry) =>
106110
Center(child: errorBuilder(context, onRetry)),
107111
loadMoreNoMoreItemsBuilder: (context) => const SizedBox.shrink(),
108-
invisibleItemsThreshold: 5,
112+
invisibleItemsThreshold: invisibleItemsThreshold,
109113
),
110114
),
111115
);

packages/wisewidgetslibrary/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: wisewidgetslibrary
22
description: Wisemen widgets library containing platform specific widgets and other commonly useful widgets.
3-
version: 2.1.1
3+
version: 2.1.2
44
homepage: https://github.com/wisemen-digital/wisemen-flutter-packages/packages/wisewidgetslibrary
55
repository: https://github.com/wisemen-digital/flutter-widgets-library/packages/wisewidgetslibrary
66

0 commit comments

Comments
 (0)