typeCheckConverter<C extends Converter<T> > method
Throws an ArgumentError if the Types of the two Converters don't match and returns the casted converter otherwise.
Implementation
@protected
C typeCheckConverter<C extends Converter<T>>(Converter<T> other) {
if (runtimeType != other.runtimeType) {
throw ArgumentError.value(
other,
'Cannot convert between $runtimeType and ${other.runtimeType}',
);
}
return other as C;
}