of static method

_ModelAdapterScope? of(
  1. BuildContext context
)

You can get adapter of a close ancestor.

By passing the adapter obtained here to CollectionModelQuery or DocumentModelQuery, it is possible to change the internal processing of the model.

近い先祖のadapterを取得することができます。

ここで取得したadapterCollectionModelQueryDocumentModelQueryに渡すことでモデルの内部処理を変更することが可能です。

Implementation

// ignore: library_private_types_in_public_api
static _ModelAdapterScope? of(BuildContext context) {
  final scope =
      context.getElementForInheritedWidgetOfExactType<_ModelAdapterScope>();
  assert(
    scope != null,
    "ModelAdapterScope is not found. Place [ModelAdapterScope] widget closer to the root.",
  );
  return scope?.widget as _ModelAdapterScope?;
}