afterData method Null safety

  1. @override
AsyncSnapshot<T> afterData(
  1. AsyncSnapshot<T> current,
  2. T data
)
override

Returns an updated version of the current summary following a data event.

Sub-classes must override this method to specify how the current summary is combined with the new data item in the fold computation.

Implementation

@override
AsyncSnapshot<T> afterData(AsyncSnapshot<T> current, T data) {
  return AsyncSnapshot<T>.withData(ConnectionState.active, data);
}