atoi method

int atoi(
  1. String str
)

Converts a string to an integer.

Implementation

int atoi(String str) {
  return int.tryParse(str) ?? 0;
}