onChildAdded method
Implementation
bool onChildAdded(DatabaseReference ref, EventCallback listener) {
final StreamSubscription<Event> sub =
ref.onChildAdded.listen((Event event) {
listener(event);
}, onError: (Object error, StackTrace stackTrace) {
setError(error);
}, onDone: () {
// print('done');
});
bool added = _addedSubscription.add(sub);
if (!added) {
added = _addedSubscription.remove(sub);
if (added) {
added = _addedSubscription.add(sub);
}
}
return added;
}