update method
First, invokes the subscribers callbacks of the willUpdate event.
Second, invokes the callback given by parameter.
And finally, invokes the subscribers callbacks of the didUpdate event.
Implementation
void update([Function? callback]) {
_event.emit(Lifecycle.willUpdate, this);
callback?.call();
_event.emit(Lifecycle.didUpdate, this);
}