stateOf<T extends StatefulWidget> method

  1. @override
StateX<StatefulWidget>? stateOf<T extends StatefulWidget>()
override

Supply this version of StateX

Implementation

@override
StateX? stateOf<T extends StatefulWidget>() {
  var state = super.stateOf<T>();
  if (state != null) {
    assert(state is! AppStateX,
    "'${state.toStringShort()}' is type, AppStateX.\nIn Fluttery, use the getter, appState, instead.");
    if (state is AppStateX) {
      state = null; // In Fluttery, AppStateX is not a subtype of this StateX
    }
  }
  return state == null ? null : state as StateX;
}