Stateless Widget

  • No State
  • has only a Constructor function and build() function

Stateful Widget

  • composed by StatefulWidget class (without build method) and State class
  • the 'State' class can change in its life cycle ( setState method, will call build() again)
  • Constructor function and then initState() and then build()

Both can have input data, build widget and render UI, and the Stateful Widget has State. Hot-reload actually calls setState rather than restart the app.

results matching ""

    No results matching ""