File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
packages/flutter/lib/src/widgets Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -321,6 +321,20 @@ typedef AsyncWidgetBuilder<T> = Widget Function(BuildContext context, AsyncSnaps
321321///
322322/// {@youtube 560 315 https://www.youtube.com/watch?v=MkKEWHfy99Y}
323323///
324+ /// ## Managing the stream
325+ ///
326+ /// The [stream] must have been obtained earlier, e.g. during [State.initState] ,
327+ /// [State.didUpdateWidget] , or [State.didChangeDependencies] . It must not be
328+ /// created during the [State.build] or [StatelessWidget.build] method call when
329+ /// constructing the [StreamBuilder] . If the [stream] is created at the same
330+ /// time as the [StreamBuilder] , then every time the [StreamBuilder] 's parent is
331+ /// rebuilt, the asynchronous task will be restarted.
332+ ///
333+ /// A general guideline is to assume that every `build` method could get called
334+ /// every frame, and to treat omitted calls as an optimization.
335+ ///
336+ /// ## Timing
337+ ///
324338/// Widget rebuilding is scheduled by each interaction, using [State.setState] ,
325339/// but is otherwise decoupled from the timing of the stream. The [builder]
326340/// is called at the discretion of the Flutter pipeline, and will thus receive a
You can’t perform that action at this time.
0 commit comments