Closed Samson11 closed 3 years ago
Could you please share the code you tried @Samson11 ?
RefreshIndicator(
child: PaginateFirestore(
itemBuilder: (index, context, documentSnapshot) {
return CommentCard(Comment.fromData(documentSnapshot.data()));
},
query: widget.commentRepository.getQuery(),
itemBuilderType: PaginateBuilderType.listView,
listeners: [refreshNotifier],
),
onRefresh: () async {
print('refressed');
refreshNotifier.refreshed = true;
},
),
class RefreshNotifier extends ChangeNotifier {
bool _refreshed;
bool get refreshed => _refreshed;
set refreshed(bool value) {
_refreshed = value;
notifyListeners();
}
}
There must be something wrong with my implementation but the readme or the example doesn't have this functionality code. @excogitatr Please say how this is done
import 'package:paginate_firestore/bloc/pagination_listeners.dart';
.
.
PaginateRefreshedChangeListener paginateNotifier = PaginateRefreshedChangeListener();
.
.
RefreshIndicator(
child: PaginateFirestore(
itemBuilder: (index, context, documentSnapshot) {
return CommentCard(Comment.fromData(documentSnapshot.data()));
},
query: widget.commentRepository.getQuery(),
itemBuilderType: PaginateBuilderType.listView,
listeners: [paginateNotifier],
),
onRefresh: () async {
paginateNotifier.refreshed = true;
},
),
I figured It out. @excogitatr I think you should make a barrel file otherwise how could people know you should import bloc/pagination_listener.dart and use the PaginateRefreshedChangeListener.
Agreed @Sreejithns2002 . Hope this fixes you issue @Samson11 as well.
Listener example is not working I am receiving syntax errors in Android Studio and will it be able to update whenever a collection changes with pulling a loader