Skip to content

Commit

Permalink
add method update index
Browse files Browse the repository at this point in the history
  • Loading branch information
juanlabrador authored and juanlabrador committed Jul 23, 2021
1 parent a481d12 commit 4d48555
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/flutter_pagewise.dart
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,15 @@ class PagewiseLoadController<T> extends ChangeNotifier {
bool get noItemsFound =>
this._loadedItems!.length == 0 && this.hasMoreItems == false;

void update(int index, T? data) {
if (data != null) {
if (_loadedItems?.isNotEmpty == true) {
_loadedItems?[index] = data;
notifyListeners();
}
}
}

/// Called to initialize the controller. Same as [reset]
void init() {
this.reset();
Expand Down

0 comments on commit 4d48555

Please sign in to comment.