User Input in dart
In Dart programming language, you can take
standard input from the user through the
console via the use of .readLineSync() function.
To take input from the console you need to
import a library, named dart:io from libraries of
Dart.
Function: stdin.readLineSync()
Example:
void main() {
int n = int.parse(stdin.readLineSync()!); // stdin.readLineSync()
used for int value
String? name = stdin.readLineSync()!; // stdin.readLineSync() used
for String value
print("enter name: ${name}");
print("enter number: ${n}");
}