parseInt static method

int? parseInt(
  1. dynamic value, [
  2. int? defaultValue
])

Parses the dynamic value into a int. The value may be a String, int, double. If the value cannot be successfully parsed into an int then [the defaultValue will be returned.

Implementation

static int? parseInt(
  dynamic value, [
  int? defaultValue,
]) =>
    parseDouble(value)?.toInt() ?? defaultValue;