At 4:42 you changed the method from directly getting number from int variable, you first crated value variable from string then calculated square ... can you pls tell me why so why didn't first method work out
Because the input from the user is always a String. String? value = stdin.readLineSync(); it reads a line of text from the user and saves it to the variable value Then we should ensure that the value is not null, that's why he used the method toString() on the value by writing: value.toString() then he parsed it to an integer with the method int.parse Btw here he does not have to use toString to ensure that value is not null, because value is already a String. He could have used the null assertion operator ! to tell Dart that we're sure that value is not null, so we can safely pass it to the int.parse() method without calling toString(). So he could write: int numericValue = int.parse(value!);
Thank you for dart tutorial
Happy learning dart
good videos
At 4:42 you changed the method from directly getting number from int variable, you first crated value variable from string then calculated square ... can you pls tell me why so why didn't first method work out
Because the input from the user is always a String. String? value = stdin.readLineSync(); it reads a line of text from the user and saves it to the variable value Then we should ensure that the value is not null, that's why he used the method toString() on the value by writing: value.toString() then he parsed it to an integer with the method int.parse Btw here he does not have to use toString to ensure that value is not null, because value is already a String. He could have used the null assertion operator ! to tell Dart that we're sure that value is not null, so we can safely pass it to the int.parse() method without calling toString(). So he could write: int numericValue = int.parse(value!);
@@shahd6228 Thank you. I've been trying to figure out what the ! was for. :)
Hello Bishoraj brother which software do you use for screen recoder as well as video editing
OBS for recording, Premiere for editing
❤️❤️❤️❤️