wrapToSql<D, S> static method

S? wrapToSql<D, S>(
  1. TypeConverter<D, S> inner,
  2. D? dartValue
)

Invokes a non-nullable inner type converter for a single conversion from Dart to SQL.

Returns null if dartValue is null, TypeConverter.toSql otherwise. This method is mostly intended to be used for code generated by drift-dev.

Implementation

static S? wrapToSql<D, S>(TypeConverter<D, S> inner, D? dartValue) {
  return dartValue == null ? null : inner.toSql(dartValue);
}