You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Suggestion to update StreamBuilder documentation for best practices on Stream initialization - as already updated with FutureBuilder. #142189
Just as the FutureBuilder documentation advises initializing the future in initState or an equivalent lifecycle method, I believe it would be highly beneficial for the StreamBuilder documentation to include similar guidance. This would help prevent common pitfalls, such as streams being recreated on every build, leading to unnecessary rebuilds and potential performance issues.
I propose adding a section or note to the StreamBuilder documentation emphasizing the importance of initializing the stream in a stable manner, similar to the advice given for FutureBuilder. This could include a brief explanation and a code snippet demonstrating the recommended practice.
Such an update would greatly assist developers in understanding and implementing StreamBuilder more effectively, ensuring more robust and efficient Flutter applications.
changed the title [-]Suggestion to update StreamBuilder Documentation for Best Practices on Stream Initialization - as already updated with FutureBuilder.[/-][+]Suggestion to update StreamBuilder documentation for best practices on Stream initialization - as already updated with FutureBuilder.[/+]on Jan 25, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[-]Suggestion to update StreamBuilder Documentation for Best Practices on Stream Initialization - as already updated with FutureBuilder.[/-][+]Suggestion to update StreamBuilder documentation for best practices on Stream initialization - as already updated with FutureBuilder.[/+]goderbauer commentedon Jan 30, 2024
Sounds good. PRs are welcome!
Add documentation for best practices for `StreamBuilder` like `Future…
github-actions commentedon Feb 27, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.