Skip to content

Commit b8585e6

Browse files
committed
generator - fix date deserialization for non-nullable types
1 parent ce3caa9 commit b8585e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

generator/lib/src/code_chunks.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ class CodeChunks {
235235
return '$valueVar == null ? null : DateTime.fromMicrosecondsSinceEpoch(($valueVar / 1000).round())';
236236
}
237237
} else {
238-
if (p.type == OBXPropertyType.DateNano) {
238+
if (p.type == OBXPropertyType.Date) {
239239
return "DateTime.fromMillisecondsSinceEpoch(${readFieldNonNull('0')})";
240-
} else {
240+
} else if (p.type == OBXPropertyType.DateNano) {
241241
return "DateTime.fromMicrosecondsSinceEpoch((${readFieldNonNull('0')} / 1000).round())";
242242
}
243243
}

0 commit comments

Comments
 (0)