toInt extension this method can be used on string as an extension to convert a string into integer
int? get toInt => int.tryParse(this!);