FirebaseSortedList constructor

FirebaseSortedList({
  1. required Query query,
  2. required Comparator<DataSnapshot> comparator,
  3. ChildCallback? onChildAdded,
  4. ChildCallback? onChildRemoved,
  5. ChildCallback? onChildChanged,
  6. ValueCallback? onValue,
  7. ErrorCallback? onError,
})

Implementation

FirebaseSortedList({
  required this.query,
  required this.comparator,
  this.onChildAdded,
  this.onChildRemoved,
  this.onChildChanged,
  this.onValue,
  this.onError,
}) {
  if (onChildAdded != null) {
    listen(query.onChildAdded, _onChildAdded, onError: _onError);
  }
  if (onChildRemoved != null) {
    listen(query.onChildRemoved, _onChildRemoved, onError: _onError);
  }
  if (onChildChanged != null) {
    listen(query.onChildChanged, _onChildChanged, onError: _onError);
  }
  if (onValue != null) {
    listen(query.onValue, _onValue, onError: _onError);
  }
}