Dart Basics - Reading input from the console

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.พ. 2021
  • In this video we look at the stdin and stdout objects and their methods to read data from the console and print to the console. Follow the full playlist here: • Introducing Flutter

ความคิดเห็น • 30

  • @prakashanuvadia8870
    @prakashanuvadia8870 2 ปีที่แล้ว

    nice explanation one of best dart explain simple any body can easily understand....sir You are one of the best professor on you tube...from your video clear my programing concept .....

  • @aufarrizkya
    @aufarrizkya 2 ปีที่แล้ว

    Thanks! Nice explanation!

  • @jeffdon9257
    @jeffdon9257 ปีที่แล้ว

    Hi
    Can you please make a video that states the exact process of validating a user email address as a well as password using regex?
    Thank you

  • @siddiquisharique
    @siddiquisharique 2 ปีที่แล้ว +2

    My code runs in debug console instead of terminal and it doesn't takes user inputs even though there is no error.

  • @MohamedAbauze
    @MohamedAbauze 7 หลายเดือนก่อน

    thanks man your solve my problem thankssss

  • @user-nf9sz6cy7l
    @user-nf9sz6cy7l 2 ปีที่แล้ว

    How to find the data type entered in terminal? Because the only data type I'm getting is " String " even tho I put numbers in there

    • @siddiquisharique
      @siddiquisharique 2 ปีที่แล้ว

      You have to convert string values to double or integers.

  • @ericberg2131
    @ericberg2131 2 ปีที่แล้ว +2

    You have to run this program from the terminal for it to work properly

  • @SINANpote
    @SINANpote ปีที่แล้ว

    thank u sir

  • @minhazrahman4828
    @minhazrahman4828 2 ปีที่แล้ว

    Hello sir why import "dart:io"; is not supported??
    they show me that "unsupported import(s) dart:io"
    what should i do now sir??

    • @JohanJurrius
      @JohanJurrius  2 ปีที่แล้ว

      Please check if it is like this: import 'dart:io';

    • @chadkhan277
      @chadkhan277 ปีที่แล้ว

      @@JohanJurrius sir i face same problem. what can i do now?

  • @Kyun_____
    @Kyun_____ 4 หลายเดือนก่อน

    Thanks

  • @texsesyt2902
    @texsesyt2902 ปีที่แล้ว +3

    for any one having error just put ! at the end.
    int num = int.parse( stdin.readLineSync() ! );

    • @younesferhat6092
      @younesferhat6092 ปีที่แล้ว

      thanks man

    • @JoneeL
      @JoneeL ปีที่แล้ว

      or it needs to be a string so you can do int num = int.parse( "${ stdin.readLineSync }" ); this will also act like a string syntax is bit harder to read.

  • @omerfarukseckin
    @omerfarukseckin 2 ปีที่แล้ว

    my code isn't working ı can't understand where is my mistake

  • @nirojthapa5077
    @nirojthapa5077 3 ปีที่แล้ว +1

    how to fix this while taking input
    Error: The argument type 'String?' can't be assigned to the parameter type 'String' because 'String?' is nullable and 'String' isn't.

    • @JohanJurrius
      @JohanJurrius  3 ปีที่แล้ว +1

      Did you check out this video of mine? th-cam.com/video/LulvhhDiqQw/w-d-xo.html . In the description of the videos you will find a link to the playlist. Better to follow the playlist.

    • @luisgassier7251
      @luisgassier7251 2 ปีที่แล้ว +3

      String? tipo = stdin.readLineSync();
      opc = int.parse(tipo!);

    • @abdulfatahbajeh6542
      @abdulfatahbajeh6542 2 ปีที่แล้ว

      Same issue over here

    • @siddiquisharique
      @siddiquisharique 2 ปีที่แล้ว

      Use var instead of String

  • @ahmedbahram4653
    @ahmedbahram4653 2 ปีที่แล้ว

    thank u

  • @mohsenahmedofficial7215
    @mohsenahmedofficial7215 2 ปีที่แล้ว

    thx

  • @josephakintola5988
    @josephakintola5988 2 ปีที่แล้ว

    Mine is saying global something

  • @ianrafaeltoh7679
    @ianrafaeltoh7679 2 ปีที่แล้ว

    not working, it will freeze the console

  • @zakariahouache5442
    @zakariahouache5442 2 ปีที่แล้ว

    void main() {
    print('what is your age');
    String age=stdin.readLineSync();
    print("your age is = $age!");
    }
    It says there is an error here where is the error in stdi

    • @JohanJurrius
      @JohanJurrius  2 ปีที่แล้ว

      What is the error?

    • @NitinVarma
      @NitinVarma 2 ปีที่แล้ว +1

      It's a null safety error.
      Try using
      Syntax: String?
      or
      Syntax: stdin.readLineSync()!;

  • @majdkillawe3193
    @majdkillawe3193 ปีที่แล้ว +2

    *** SOLUTION FOR THE INT.PARSE **
    int x =int.parse(stdin.readLineSync()!)