anyToInt function

int anyToInt(
  1. dynamic value
)

转为 int 默认为 0

Implementation

int anyToInt(dynamic value) {
  var result = int.tryParse("$value");
  return result ?? 0;
}