asDoubles method
多字段解析成double值
Implementation
double asDoubles(List<String> keys, [double? defValue]) {
if (this == null) return defValue ?? 0.0;
for (String key in keys) {
Object? value = this![key];
if (value == null) continue;
if (value is double) return value;
try {
double result = double.parse(value.toString());
return result;
} catch (e) {
print(e);
_print('json parse failed,exception value::\"$key\":$value');
_printDetail('asDoubles', key, this);
}
}
return defValue ?? 0.0;
}