Skip to content

Commit 7cfe7a4

Browse files
committed
Merge remote-tracking branch 'origin/patch-2'
2 parents 51101ba + a4045a6 commit 7cfe7a4

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/paging.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,17 @@ class _PaginationState<T> extends State<Pagination<T>> {
9191
if (list.isEmpty) {
9292
_isEndOfList = true;
9393
}
94-
setState(() {
95-
_list.addAll(list);
96-
});
94+
if (mounted) {
95+
setState(() {
96+
_list.addAll(list);
97+
});
98+
}
9799
}).catchError((error) {
98-
setState(() {
99-
_isEndOfList = true;
100-
});
100+
if (mounted) {
101+
setState(() {
102+
_isEndOfList = true;
103+
});
104+
}
101105
print(error);
102106
if (widget.onError != null) {
103107
widget.onError(error);

0 commit comments

Comments
 (0)