Search code examples
flutterflutter-dependencies

What is init state in flutter?


I have seen in various files about init method under some classes, why we use this method and please also describe other useful methods if you know, Thanks

I have initialized this method but it didn't work properly.


Solution

  • To understand the methods and structure of flutter widgets, you need to understand the lifecycle of flutter screen or flutter application.

    So, basically flutter's stateful widgets have really good methods which are

    1. CreateState()
    2. initState()
    3. didChangeDependencies()
    4. build()
    5. deactivate()
    6. dispose()

    You can learn more about this on medium