parseValue static method

int? parseValue(
  1. String? text
)

Implementation

static int? parseValue(String? text) {
  if (text == null) return null;
  //Remove all non-numeric characters
  final cleanStr = text.replaceAll(RegExp(r'[^\d]'), '');
  return int.tryParse(cleanStr) ?? 0;
}