FirebaseList constructor

FirebaseList({
  1. required Query query,
  2. ChildCallback? onChildAdded,
  3. ChildCallback? onChildRemoved,
  4. ChildCallback? onChildChanged,
  5. ChildMovedCallback? onChildMoved,
  6. ValueCallback? onValue,
  7. ErrorCallback? onError,
})

Implementation

FirebaseList({
  required this.query,
  this.onChildAdded,
  this.onChildRemoved,
  this.onChildChanged,
  this.onChildMoved,
  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 (onChildMoved != null) {
    listen(query.onChildMoved, _onChildMoved, onError: _onError);
  }
  if (onValue != null) {
    listen(query.onValue, _onValue, onError: _onError);
  }
}