int convertToInt(String? value) { try { if (value != null) { return int.parse(value); } else { return 0; } } catch (e) { return 0; } }