The-ring-io / flutter_phoenix

Easily restart your application from scratch.
MIT License
153 stars 17 forks source link

dependOnInheritedWidgetOfExactType() or dependOnInheritedElement() was called before _MyAppState.initState() completed. #10

Closed abdullah4one closed 3 years ago

abdullah4one commented 3 years ago

After adding flavor to app showing error when we run it "dependOnInheritedWidgetOfExactType() or dependOnInheritedElement() was called before _MyAppState.initState() completed." Code from here https://cogitas.net/creating-flavors-of-a-flutter-app/

Error messages "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."

var configuredApp = AppConfig( appDisplayName: "Staging", env: AppEnv.STAGING, child: Phoenix( child: MyApp(), ), );

ahmed-Ftkhhar commented 2 years ago

did you figure out the solution?