isForType method

  1. @override
bool isForType(
  1. Type type
)
override

Implementation

@override
bool isForType(Type type) {
  try {
    var newArgs = apply(DecodingContext(args: () => type.args));
    var instantiatedType = typeFactory
        .callWith(parameters: [<T>() => T], typeArguments: newArgs);
    return type == instantiatedType;
  } catch (_) {
    return false;
  }
}