How to take input from user

Jeet BhaluJeet Bhalu
1 min read

input user:

in Dart, you can take input from the user using the stdin stream from the dart:io library.

import 'dart:io';

void main() {
  // Prompt the user for input
  print('Enter your name: ');

  // Read the input from the user
  String? userInput = stdin.readLineSync();

  // Display the input
  print('Hello, $userInput!');
}
  1. We import the dart:io library to access the standard input/output streams.
0
Subscribe to my newsletter

Read articles from Jeet Bhalu directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Jeet Bhalu
Jeet Bhalu

i am Jeet Bhalu i am flutter App developer