I am building a dart program to get the user input. when running the program using the run button I get the output in the output window but I cannot type in it. tried using the terminal to run the program and it worked well. so I want to know what is the right way to take the input from the user?
import 'dart:io';
void main() {
print("enter your name: ");
var name = stdin.readLineSync();
print("hello mrs ${name}");
}
From file -> Preferences -> Settings search for "Dart: Cli Console" Dart: Cli Console
Then change the drop-down menu into -terminal- now you can run again your code and check you can type in the terminal and your code will work.
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