![]() What I'm trying to achieve is to check when the page is rendered to perform some checks and based on them opening a AlertDialog to make some settings if needed. initState () method is called only and only once and is used generally for initializing the previously defined variables of the stateful widget. Desired behavior: When Home screen opens, app should check if users email verified, if it's not then should show dialog popup. Most probably that data would had to come from ctor (meaning this widget should be inside a Consumer). 32 I am refactoring my Flutter application code by adding Provider as a state management.initState () method is overridden mostly because as mentioned earlier it is called only once in its lifetime. ![]() It is basically the entry point for the Stateful Widgets. Provider is one of the most popular and mature methods for state management in Flutter. If you need data for this page in initState, youre doing it wrong. It is basically the entry point for the Stateful Widgets. I'm not sure if the initState is the right function for this. The initState () is a method that is called when an object for your stateful widget is created and inserted inside the widget tree.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |