StateMVC<T extends StatefulWidget> constructor
StateMVC<T extends StatefulWidget> ([
- ControllerMVC? _controller
With an optional Controller parameter, this constructor imposes its own Error Handler.
Implementation
StateMVC([this._controller]) : currentErrorFunc = FlutterError.onError {
/// If a tester is running. Don't switch out its error handler.
if (WidgetsBinding.instance == null ||
WidgetsBinding.instance is WidgetsFlutterBinding) {
/// This allows one to place a breakpoint at 'onError(details)' to determine error location.
FlutterError.onError = onError;
} else {
_inTester = WidgetsBinding.instance is TestWidgetsFlutterBinding;
}
/// IMPORTANT! Assign itself to stateView before adding any Controller. -gp
_stateMVC = this;
/// Collect all the StateMVC objects to the 'root' State object;
rootState?._addStateMVC(this);
/// Any subsequent calls to add() will be assigned to stateMVC.
add(_controller);
}