build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Calls the required Function object: Function(BuildContext context, T? object) and passes along the InheritedWidget's custom 'object'

Implementation

@override
Widget build(BuildContext context) {
  /// Go up the widget tree and link to the App's inherited widget.
  context.dependOnInheritedWidgetOfExactType<_AppInheritedWidget>();

  final rootState = RootState._rootStateX;

  if (rootState != null) {
    rootState._inSetStateBuilder = true;
    StateX._setStateAllowed = false;
  }

  final Widget widget = builder(context, rootState?._dataObj);

  if (rootState != null) {
    StateX._setStateAllowed = true;
    rootState._inSetStateBuilder = false;
  }
  return widget;
}