in vs code, i am getting this error in the basic input taking code from the user my complete code:
import 'dart:io';
void main(){
stdout.write("Enter your name : ");
var name = stdin.readLineSync();
stdout.write(name);
}
Error in the compiler:
playground.dart:9:23: Error: Method not found: 'Stdin.readLineSync'.
String name = Stdin.readLineSync();
^^^^^^^^^^^^
To learn dart as console application you should use IntelliJ IDEA IDE.
This is the best IDE for dart.
vscode, dartpad does not support stdin stdout.
You must add:
import 'dart:io';
before your main function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With