void didUpdateWidget(StatefulWidget statefulWidget) { var oldWidget = statefulWidget as FutureBuilder <T>; if (oldWidget == null) { return; } base.didUpdateWidget(oldWidget); if (oldWidget.future != widget.future) { if (_activeCallbackIdentity != null) { _unsubscribe(); _snapshot = _snapshot.inState(ConnectionState.none); } _subscribe(); } }
AsyncSnapshot <T> afterDone(AsyncSnapshot <T> current) => current.inState(ConnectionState.done);
AsyncSnapshot <T> afterDisconnected(AsyncSnapshot <T> current) => current.inState(ConnectionState.none);
AsyncSnapshot <T> afterConnected(AsyncSnapshot <T> current) => current.inState(ConnectionState.waiting);