Skip to content

Instantly share code, notes, and snippets.

@mingsai
Created August 27, 2021 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mingsai/244db963dd00dc623720b261b7ffd3e6 to your computer and use it in GitHub Desktop.
Save mingsai/244db963dd00dc623720b261b7ffd3e6 to your computer and use it in GitHub Desktop.
Flutter rebuild all widgets
void _rebuildAllChildren(BuildContext context) {
void rebuild(Element el) {
el.markNeedsBuild();
el.visitChildren(rebuild);
}
(context as Element).visitChildren(rebuild);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment