get<T> static method

T get<T>(
  1. BuildContext context
)

Implementation

static T get<T>(BuildContext context) {
  try {
    final t = Provider.of<T>(context, listen: false);
    return t;
  } on ProviderNotFoundException {
    print("##################################  ${T} was found under ${T}?");
    print("##################################");
    final t = Provider.of<T?>(context, listen: false);
    if (t == null) {
      rethrow;
    }
    // ignore: unnecessary_cast
    return t as T;
  }
}