View
View is an extension from State.
ViewWidget is an extension from Widget.
#
LifecycleMost of these callbacks are optionals but can be overriden according to our needs.
Developers should use these callbacks instead of system callbacks to maintain a view.
#
onCreatevoid onCreate()
This callback is called only when widget creates the view.
#
onDisposevoid onDispose()
This callback is called only when widget disposes the view.
#
buildContentWidget? buildContent(BuildContext context)
This callback is called only when view builds the content.
#
notifyChangesvoid notifyChanges(VoidCallback? callback)
Notify changes in the view and schedule an update. Provided callback is immediately called synchronously.
#
ViewModelViewModel? getViewModel()void setViewModel(ViewModel? viewModel)
Optionally we can assign a view-model for the view. Though optional but should be done inside onCreate.