toInt method

int toInt()

Parses an int, 0 when it is not one. "42" → 42

Implementation

int toInt() => int.tryParse(this) ?? 0;