setRootStateX method

bool setRootStateX(
  1. StateX<StatefulWidget>? state
)
inherited

Important to record the 'root' StateX object. Its an InheritedWidget!

Implementation

bool setRootStateX(StateX? state) {
  // This can only be called once successfully. Subsequent calls are ignored.
  // Important to prefix with the class name to 'share' this as a mixin.
  final set =
      state != null && RootState._rootStateX == null && state is AppStateX;
  if (set) {
    // Important to prefix with the class name to 'share' this as a mixin.
    RootState._rootStateX = state;
  }
  return set;
}