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
If I use ReactionBuilder with a fireImmediately reaction or autorun flutter throws the following error:
Error: dependOnInheritedWidgetOfExactType<_ScaffoldMessengerScope>() or dependOnInheritedElement() was called before ReactionBuilderState.initState() completed.
When an inherited widget changes, for example if the value of Theme.of() changes, its dependent widgets are rebuilt. If the dependent widget's reference to the inherited widget is in a constructor or an initState() method, then the rebuilt dependent widget will not reflect the changes in the inherited widget.
Typically references to inherited widgets should occur in widget build() methods. Alternatively, initialization based on inherited widgets can be placed in the didChangeDependencies method, which is called after initState and whenever the dependencies change thereafter.
This is because the inherited widget is accessed using the context from ReactionBuilder before the initState of ReactionBuilder has finished.
This can be reproduced in the example app by changing connectivity_widgets.dart the reaction to fireImmediately
If I use ReactionBuilder with a fireImmediately reaction or autorun flutter throws the following error:
Error: dependOnInheritedWidgetOfExactType<_ScaffoldMessengerScope>() or dependOnInheritedElement() was called before ReactionBuilderState.initState() completed.
When an inherited widget changes, for example if the value of Theme.of() changes, its dependent widgets are rebuilt. If the dependent widget's reference to the inherited widget is in a constructor or an initState() method, then the rebuilt dependent widget will not reflect the changes in the inherited widget.
Typically references to inherited widgets should occur in widget build() methods. Alternatively, initialization based on inherited widgets can be placed in the didChangeDependencies method, which is called after initState and whenever the dependencies change thereafter.
This is because the inherited widget is accessed using the context from ReactionBuilder before the initState of ReactionBuilder has finished.
This can be reproduced in the example app by changing connectivity_widgets.dart the reaction to fireImmediately
The text was updated successfully, but these errors were encountered: