Fixed issue #75
This commit is contained in:
parent
cec05d8c19
commit
0301b300ad
1 changed files with 5 additions and 1 deletions
|
@ -299,6 +299,8 @@ class OrmGenerator extends GeneratorForAnnotation<Orm> {
|
|||
} else if (fType.element2?.displayName == 'DateTime') {
|
||||
defaultRef = CodeExpression(
|
||||
Code('DateTime.parse("1970-01-01 00:00:00")'));
|
||||
} else if (fType.isDartCoreList) {
|
||||
defaultRef = CodeExpression(Code('[]'));
|
||||
}
|
||||
}
|
||||
expr = refer('fields').property('contains').call([
|
||||
|
@ -881,7 +883,9 @@ class OrmGenerator extends GeneratorForAnnotation<Orm> {
|
|||
.isAssignableFromType(fType)) {
|
||||
value = refer('json')
|
||||
.property('decode')
|
||||
.call([value.asA(refer('String'))]).asA(refer('List'));
|
||||
.call([value.asA(refer('String'))])
|
||||
.property('cast')
|
||||
.call([]);
|
||||
} else if (floatTypes.contains(ctx.columns[field.name]?.type)) {
|
||||
value = refer('double')
|
||||
.property('tryParse')
|
||||
|
|
Loading…
Reference in a new issue