WidgetModel constructor
WidgetModel(
- WidgetModel? parent,
- String? id, {
- Scope? scope,
- dynamic data,
Implementation
WidgetModel(this.parent, String? id, {Scope? scope, dynamic data}) {
// set the id
this.id = getUniqueId(id);
// set the scope
this.scope = scope ?? Scope.of(this);
isLocalScope = scope != null;
// set the framework
framework = findAncestorOfExactType(FrameworkModel);
// set the data
if (data != null) this.data = data;
// register the model
this.scope?.registerModel(this);
}