parseInt static method
获取int值
defValue
默认值
Implementation
static int parseInt(String? valueStr, {int? defValue}) {
if (valueStr == null || valueStr.isEmpty)
return defValue == null ? 0 : defValue;
var newValue = int.tryParse(valueStr);
if (newValue == null) {
return defValue == null ? 0 : defValue;
}
return newValue;
}