Getting Input from User Example Program in Dart


Example Program:

Here is the simple program for printing basic example of getting input from user in dart.

Source Code

import 'dart:io';
void main(){
   var name,age;
   print('Enter Name & Age : ');
   name=stdin.readLineSync();
   age=int.parse(stdin.readLineSync());
   print(name.runtimeType);
   print(age.runtimeType);
   stdout.write('Name : $name | Age : $age');
}
To download raw file Click Here

Output

Enter Name & Age : 
Tutor Joe's
20
String
int
Name : Tutor Joe's | Age : 20


Learn All in Tamil © Designed & Developed By Tutor Joes