diff --git a/drift_dev/lib/src/writer/tables/data_class_writer.dart b/drift_dev/lib/src/writer/tables/data_class_writer.dart index 06108fa1..15d858bc 100644 --- a/drift_dev/lib/src/writer/tables/data_class_writer.dart +++ b/drift_dev/lib/src/writer/tables/data_class_writer.dart @@ -228,7 +228,9 @@ class DataClassWriter { // We include all columns that are not null. If nullToAbsent is false, we // also include null columns. Since we' generating NNBD code, we can // include non-nullable columns without an additional null check. - final needsNullCheck = column.nullable; + final needsNullCheck = column.typeConverter != null + ? column.typeConverter!.dartTypeIsNullable + : column.nullable; final needsScope = needsNullCheck || column.typeConverter != null; if (needsNullCheck) { _buffer.write('if (!nullToAbsent || ${column.dartGetterName} != null)');