toInt function

int? toInt(
  1. Object? value
)

Implementation

int? toInt(Object? value) {
  final numValue = toNum(value);
  // 只对有限数字(非NaN、非Infinity)进行四舍五入
  return (numValue != null && numValue.isFinite) ? numValue.round() : null;
}