|
|
|
@ -198,11 +198,19 @@ String findFromJsonHandling(
|
|
|
|
|
'int53': 'int', |
|
|
|
|
'Bool': 'bool', |
|
|
|
|
}; |
|
|
|
|
final predefinedDefault = { |
|
|
|
|
'double': '0', |
|
|
|
|
'string': "''", |
|
|
|
|
'int32': '0', |
|
|
|
|
'int53': '0', |
|
|
|
|
'Bool': 'false', |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if (predefined.containsKey(type)) { |
|
|
|
|
return '$varAccess as ${predefined[type]}'; |
|
|
|
|
return '($varAccess as ${predefined[type]}?) ?? ${predefinedDefault[type]}'; |
|
|
|
|
} |
|
|
|
|
else if (type == 'int64') { |
|
|
|
|
return 'int.parse($varAccess)'; |
|
|
|
|
return "int.parse($varAccess ?? '0')"; |
|
|
|
|
} |
|
|
|
|
else if (type == 'bytes') { |
|
|
|
|
return 'base64.decode($varAccess)'; |
|
|
|
|