toInt method
Transform string to int type
Implementation
int? toInt({bool nullOnError = false}) {
int? i = int.tryParse(this);
if (i != null) return i;
if (nullOnError) return null;
throw FormatException('Can only acception double value');
}