toInt method

int? toInt()

Converts the string to an int or returns null if conversion fails.

Implementation

int? toInt() {
  return int.tryParse(this);
}