Every time i need to input certain variable as integer i used to use this below code for that
import 'dart:io';
void main(List<String> arguments) {
int a = 0;
print("Enter a :");
String? x = stdin.readLineSync();
if (x != null) {
a = int.parse(x);
}
}
which is very hectic...very since the null safety was added from Dart 2.12 version.Before it the integer was inputted using this code int n = int.parse(stdin.readLineSync());
can anyone propose to make it smaller...since its hefty..