0

I do not understand what is wrong here as I have copied and pasted code from a youtube video. The reason why I have put var in front of accepting user input is because if I put String as the guy in the video did it just wont work for me, but for him it works, the video is 8 months old, has something changed with Flutter, am I missing something or am I just plain dumb...?

import "dart:io";

void main() {
  print("Enter first number: ");
  var num1 = stdin.readLineSync();
  print("Enter second number: ");
  var num2 = stdin.readLineSync();
  print(
  int.parse(num1) + int.parse(num2)
 );

}

0 Answers0