initial method Null safety

  1. @override
AsyncSnapshot<T> initial()
override

Returns the initial summary of stream interaction, typically representing the fact that no interaction has happened at all.

Sub-classes must override this method to provide the initial value for the fold computation.

Implementation

@override
AsyncSnapshot<T> initial() => initialData == null
    ? AsyncSnapshot<T>.nothing()
    : AsyncSnapshot<T>.withData(ConnectionState.none, initialData as T);