Async, Await, and Future Keywords in Flutter | Dart | Asynchronous Programming | Hindi

Поделиться
HTML-код
  • Опубликовано: 30 июл 2024
  • Async, await, and Future are keywords that are used in Dart and Flutter to support asynchronous programming.
    Async: The async keyword is used to mark a function as asynchronous. An asynchronous function is a function that can perform a long-running operation without blocking the execution of the program. When an asynchronous function is called, it returns a Future object that represents the eventual result of the function.
    Await: The await keyword is used to pause the execution of an asynchronous function until a Future completes. When an asynchronous function is called with the await keyword, the function will pause at that point and wait for the Future to complete before continuing. This allows you to write asynchronous code that looks and behaves like synchronous code, making it easier to read and understand.
    Future: The Future class is a core class in Dart that represents a value that may not be available yet. A Future can be used to represent the result of an asynchronous operation, and can be used with the await keyword to pause the execution of a function until the Future completes.
    My RUclips Gear:
    Boya BYM1(Mic): amzn.to/3bvm69j
    Redmi Note 7 Pro(Mic & Camera): amzn.to/3uRkVsb
    MSI Motherboard: amzn.to/3fiQHYO
    Intel i3 Processor: amzn.to/3w8TWbQ
    Mouse: amzn.to/3yb8PMP
    Keyboard: amzn.to/3bvmtkd
    Wifi Adaptor: amzn.to/3fiQYuO
    SSD: amzn.to/3w2w2Pa
    Speakers: amzn.to/3w6pKhv
    Instagram: / ahirlog
    Facebook: / ahirlog
    Twitter: / ahirlog
    RUclips: / ahirlog
    #ahirlog #flutter #dart
    Last Summer by Ikson: / ikson​
    Music promoted by Audio Library • Last Summer - Ikson (N...

Комментарии • 28

  • @prabinlamsal74
    @prabinlamsal74 Год назад +7

    Dear beginners in dart and flutter,
    The example shown in this video doesn't exactly depict how async and await usually work in flutter.
    void main() async{
    print ('"line 1');
    await fetchData();
    print ('"line 2);
    }
    Future fetchData() async{
    Future.delayed(Duration(seconds:5), ()=> print("line 2"));
    }
    Yes, in this case, the output will be as shown in the video. But this is a really rare senario where the fetchData() function doesn't return anything. If the return keyword is used, then the order of execution will be totally different.The await keyword makes the code below it wait for its execution. That way of execution is generally the normal workflow of asynchronous progamming and this is just a special case where the workflow is quite different.
    So, please read a separate blog/video about asynchronous programming in dart after watching this video.

    • @azam_izm
      @azam_izm 4 месяца назад

      thank you

  • @acornerofherheart-jr9pl
    @acornerofherheart-jr9pl 4 месяца назад +1

    thanks for the explanation i have used the method but didnt know exact things till today.... helpful for me

  • @rohittanwar8428
    @rohittanwar8428 3 месяца назад +1

    Hy I tried this program by my self and I notice that when I didn't use async , future , await in code still I was getting same result why is that.line 1 and Line 3 was executing before and then l2

  • @quadirkhan6751
    @quadirkhan6751 Год назад

    U r back 🔥

  • @someshsahu4638
    @someshsahu4638 Год назад +1

    Nice video thankyou 🙏🏼🙏🏼🙏🏼

  • @thevasimkhan2284
    @thevasimkhan2284 Год назад +2

    dear you are really great teacher because your explain way is easy to understood. "thanks" and if possible to create interviews play list ....

    • @ahirlog
      @ahirlog  Год назад

      I will create a video on this

  • @user-le2ku4my8h
    @user-le2ku4my8h 10 месяцев назад

    Nice explanation❤

  • @KDramaEntertainmentTales
    @KDramaEntertainmentTales Год назад

    great video

  • @ehsanhasin8092
    @ehsanhasin8092 Год назад

    thank you

  • @darshitkanani8977
    @darshitkanani8977 Год назад

    dear you are great teacher.thank you bhai and next videos is getext
    stat management

  • @vishalmalyan2269
    @vishalmalyan2269 Год назад +1

    great video .

  • @earnmoneyonline5096
    @earnmoneyonline5096 Год назад

    Dart Tutorials ke sabhi baki videos jaldi upload kro sir

  • @foodxcooking4448
    @foodxcooking4448 Год назад

    bro ap dart ki website sa dekha kar line by line with explaination kar ka vedio banaiyn in hindi 🙏🙏🙏🙏

  • @bobhero7
    @bobhero7 Год назад

    Dart series chahiye sir

    • @ahirlog
      @ahirlog  Год назад

      Already uploaded, check out the dart playlist

  • @rider_next_door
    @rider_next_door 2 месяца назад

    Bhai ye wrong hai jo btaya hai aise nhi chlata ye.

  • @theUnlimite
    @theUnlimite Год назад +1

    Firebase se data lena sikao

  • @azadsaifi5919
    @azadsaifi5919 Год назад

    Sir please SqlLite shuru kijiye sir please please please sir 😇

    • @ahirlog
      @ahirlog  11 месяцев назад +1

      I will make

  • @ctvtechno4992
    @ctvtechno4992 Год назад

    Rest Api

  • @prajwallamkhade9477
    @prajwallamkhade9477 Год назад

    Thank you