asDouble method
Implementation
double asDouble(String key, {double def = 0}) {
final value = this[key];
if (value == null) {
return def;
}
if (value is double) {
return value;
}
try {
String value0 = value.toString();
if (value0.isEmpty) {
return 0;
}
final double result = double.parse(value0);
return result;
} catch (e) {
_print('json 解析异常,异常值,期望double值:"$key":$value');
}
return 0.0;
}