toInt method

int? toInt()

Converts the String to an integer.

Example:

print("123".toInt()); // 123

Implementation

int? toInt() => isNotEmptyOrNull ? int.tryParse(this!) : null;