activate method

Called when this ViewModel and BaseView are reinserted into the tree after having been removed via deactivate.

In most cases, after a ViewModel has been deactivated, it is not reinserted into the tree, and its dispose method will be called to signal that it is ready to be garbage collected.

In some cases, however, after a ViewModel has been deactivated, it will reinserted it into another part of the tree (e.g., if there is a subtree uses a GlobalKey that match with key of the BaseView linked with this ViewModel).

This method does not called the first time a WidgetModel object is inserted into the tree. Instead, calls initState in that situation.

Implementations of this method should start with a call to the inherited method, as in super.activate().

Implementation

@protected
@mustCallSuper
@visibleForTesting
void activate() {
  log('ViewModel<$runtimeType> activate');
}