ElementaryModel class abstract

The base class for an entity that contains a business logic required for a specific inheritor of ElementaryWidget.

You can implement this class freestyle. It may be a bunch of methods, streams or something else. Also it is not a mandatory for business logic to be implemented right inside the class, this model can be proxy for other responsible entities with business logic.

This class can take ErrorHandler as dependency for centralize handling error (for example logging). The handleError method can be used for it. When the handleError is called passed ErrorHandler handles exception. Also the WidgetModel is notified about this exception with WidgetModel.onErrorHandle method.

The part of Elementary Lifecycle

Implementers

Constructors

ElementaryModel({ErrorHandler? errorHandler})
Create an instance of ElementaryModel.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Prepares the ElementaryModel to be completely destroyed.
handleError(Object error, {StackTrace? stackTrace}) → void
Can be used for send error to ErrorHandler if it defined and notify WidgetModel.
init() → void
Initializes ElementaryModel.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setupWmHandler(void function(Object)?) → void
Method for setup ElementaryModel for testing. This method can be used to WidgetModels error handler.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited