extractNumberFromString method

double? extractNumberFromString()

Returns the number inside a String.

Implementation

double? extractNumberFromString() {
  final RegExp regExp = RegExp(r"[^\d.]+");
  final String numStr = replaceAll(regExp, "");
  return double.tryParse(numStr);
}