toInt method

int? toInt()

尝试解析为 int;非整数或 null 返回 null。

Implementation

int? toInt() {
  final s = this;
  if (s == null) return null;
  return int.tryParse(s);
}