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; }