The lifecycle method ______ is called only once when the widget is created in Flutter.

  • build()
  • didUpdateWidget()
  • dispose()
  • initState()
The lifecycle method initState() in Flutter is called only once when the widget is created. It is used for one-time initialization tasks, such as setting up controllers or listeners. Developers often use this method to perform actions that should only occur when the widget is first created, ensuring proper setup before the widget is displayed.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *