hasConverterNullEncode function

bool? hasConverterNullEncode(
  1. DartType targetType,
  2. TypeHelperContextWithConfig ctx
)

If there is no converter for the params, return null.

Otherwise, returns true if the converter has a null return value.

Used to make sure we create a smart encoding function.

Implementation

bool? hasConverterNullEncode(
  DartType targetType,
  TypeHelperContextWithConfig ctx,
) {
  final data = _typeConverter(targetType, ctx);

  if (data == null) {
    return null;
  }

  return data.jsonType.isNullableType;
}