How can I get user input of type integer in dart? I tried the following, but does not work.
int calculate(){
int x = int.parse(stdin.readLineSync());
int y = int.parse(stdin.readLineSync());
return x + y;
}
I got this error:
Error: The argument type 'String?' can't be assigned to the parameter type 'String' because 'String?' is nullable and 'String' isn't.**