register static method

void register(
  1. BuildContext context, {
  2. Iterable<Object>? aspects,
})

Register widget to the Host, and add aspects to the regAspects return the TModel

Implementation

static void register(
  BuildContext context, {
  Iterable<Object>? aspects,
}) {
  if (aspects == null || aspects.isEmpty) {
    InheritedMediator.inheritFrom<InheritedMediator>(context);
    // aspects is null, no need to `addRegAspects`
    return;
  }

  InheritedMediator.inheritFrom<InheritedMediator>(context, aspect: aspects);

  /// Add [aspects] to the registered aspects of the model
  // if (aspects != null) {
  _globalAllAspects.addAll(aspects);
  // }
}