of<T extends DataController<Entity<EntityKey>>> static method

T of<T extends DataController<Entity<EntityKey>>>(
  1. BuildContext context
)

Implementation

static T of<T extends DataController>(BuildContext context) {
  try {
    final x = _of(context).controllers.firstWhere((e) => e is T);
    if (x is T) {
      return x;
    } else {
      throw const DataException();
    }
  } catch (_) {
    rethrow;
  }
}