toDouble function

double? toDouble(
  1. dynamic value
)

Implementation

double? toDouble(dynamic value) {
  try {
    if (value == null || value.toString().isEmpty) {
      return 0.0;
    }
    return double.tryParse(value.toString());
  } catch (e) {
    return 0.0;
  }
}