ZenBuilder<T extends ZenController> constructor
const
ZenBuilder<T extends ZenController> ({})
Creates a widget that rebuilds when the controller updates.
The builder
function is called with the current BuildContext and controller instance.
The tag
parameter can be used to identify specific controller instances.
The id
parameter can be used to listen to specific update events.
The scope
parameter explicitly defines which scope to use for controller lookup.
The create
parameter provides a factory function for controller creation if not found.
The init
parameter allows initialization of newly created controllers.
The disposeOnRemove
parameter controls whether locally created controllers should be disposed.
Implementation
const ZenBuilder({
required this.builder,
this.tag,
this.id,
this.scope,
this.create,
this.init,
this.disposeOnRemove = false,
this.onError,
super.key,
}) : assert(disposeOnRemove == false || create != null,
'disposeOnRemove requires create function');