Assign the class with the AppState object.
bool setAppState(v.AppState? vw) { // Only assigned once with the first call. _appState ??= vw; return vw != null; }