dataObject property

Object? get dataObject
inherited

This is of type Object allowing you to propagate any class object you wish down the widget tree.

Implementation

Object? get dataObject => rootState?._dataObj;
set dataObject (Object? object)
inherited

Assign an object to the property, dataObject. It will not assign null and if SetState objects are implemented, will call the App's InheritedWidget to be rebuilt and call its dependencies.

Implementation

set dataObject(Object? object) {
  // Never explicitly set to null
  if (object != null) {
    final state = rootState;
    final dataObject = state?._dataObj;
    // Notify dependencies only if their was a change.
    if (dataObject == null || dataObject != object) {
      state?._dataObj = object;
      // Call inherited widget to 'rebuild' any dependencies
      state?.notifyClients();
    }
  }
}