read<G extends GetAny> method

  1. @override
G read<G extends GetAny>(
  1. G get, {
  2. bool autoVsync = true,
  3. bool useScope = true,
})
override

Implementation

@override
G read<G extends GetAny>(G get, {bool autoVsync = true, bool useScope = true}) {
  switch (_dependencyMap[get]) {
    case null:
    case _ when !useScope:
      break;
    case final G g:
      return g;
    default:
      assert(
        throw FlutterError.fromParts([
          ErrorSummary('Invalid substitution found in a "computed" callback.'),
          ErrorDescription('Original object: $get'),
          ErrorDescription('Substituted with: ${_dependencyMap[get]}'),
          ErrorHint('Consider changing or removing this substitution.'),
        ]),
      );
  }
  return get;
}