mapToDouble function
Implementation
double mapToDouble(dynamic value) {
if (value == null) {
return 0.0;
}
if (value is String) {
return double.tryParse(value) ?? 0.0;
}
if (value is! double) {
return 0.0;
}
return value;
}