ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

Generator Functions - Flutter in Focus

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ส.ค. 2024
  • This is the fifth video in the Flutter in Focus series on asynchronous coding in Dart. In this episode, learn about generator functions (sync and async), how they work, and where to use them.
    Async and await → goo.gle/30CzAs2
    Asynchrony support → goo.gle/2JOxpum
    Flutter in Focus Playlist → goo.gle/Flutte...
    Get started with Flutter → flutter.dev
    Try a Flutter codelab → goo.gl/d3fHPo
    Join the conversation → goo.gl/68oUnb
    This video is also subtitled in Chinese, Indonesian, Italian, Japanese, Korean, Portuguese, and Spanish.
    Subscribe to the Flutter channel → goo.gle/FlutterYT
    #dart #darttopic

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

  • @Vertson
    @Vertson 5 ปีที่แล้ว +191

    I feel like this guy would give good hugs

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

      warm and soft 😅

    • @gohamza99
      @gohamza99 4 ปีที่แล้ว

      hahaha

    • @remoteportal
      @remoteportal 4 ปีที่แล้ว

      "Oh, wait! I forgot to give you a hug!" - Elf

    • @sodiboo
      @sodiboo 4 ปีที่แล้ว +7

      i feel like the entire flutter team would give good hugs, they seem very nice - or at least all of the ones who show up in the videos like flutter in focus and widget of the week - This guy really feels like flutter's mascot though in my opinion

    • @montez.youtube
      @montez.youtube 2 ปีที่แล้ว

      a little beard rub on the top of your forehead hug

  • @GeorgeRappel
    @GeorgeRappel 5 ปีที่แล้ว +7

    I honestly love everything about this series and this channel. The team is great, you manage to explain everything in a clear and cool way. It really grabs our attention and makes us want to listen. Thank you!

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

    Every time I come back to this video I learn something new.

  • @michelfeinstein
    @michelfeinstein 5 ปีที่แล้ว +19

    Andrew, could you share a situation where a Generator saved your day?

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

    I'm so glad to have followed this series. With an amazing grasp of asynchronous programming in dart, it's off to write clean code for flutter apps and corresponding business logic. Thank Flutter team

  • @cyrilledakhlia3761
    @cyrilledakhlia3761 ปีที่แล้ว +4

    I love so much the high quality content you are providing on this channel. It is clear, simple, and funny. What else could we possibly ask for

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

      Thank you for the kind message of support, Cyrille! We love having you in the Flutter community 😎
      Be sure to check out the "Flutter in Focus" playlist here:
      goo.gle/FlutterInFocus

  • @martinseal1987
    @martinseal1987 5 ปีที่แล้ว +4

    Brilliant explanation as usual love your tone and delivery, but this one went over my head a little will yield* watch it again

    • @jajasaria
      @jajasaria 5 ปีที่แล้ว

      Same here. This kind of coding is something new to me. Also, Im thinking where I could implement this on my real-world application.

  • @muhammadmusharaf4705
    @muhammadmusharaf4705 11 หลายเดือนก่อน

    Thank you so much Andrew. you really resolved mystries this series. Thanks again man

  • @gelsonmr
    @gelsonmr 5 ปีที่แล้ว +8

    You won me with the "Dart rockstar" part! Hahaha
    Could you share with us more info about the situation where you needed to use async generators?

    • @RendyEzaPutra
      @RendyEzaPutra 4 ปีที่แล้ว +1

      I found Flutter BLoC pattern tutorial, and its using async generators

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

    Your Last episode is so amazing, you tell me many things about the function. I learned a lot from this video, thank you. 💞💞

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

    What a nice series!! I I have learned a lot. Thank you so much

  • @gabrielmoreyra3365
    @gabrielmoreyra3365 5 ปีที่แล้ว +1

    Finally! My most awaited video on this series.

  • @JustinEltoft
    @JustinEltoft 5 ปีที่แล้ว +1

    I love these video series. The highlight of my Friday!

  • @bulbally6384
    @bulbally6384 3 ปีที่แล้ว

    You have given very good and good information about generator function, you have very interesting 🙏🏻

  • @arainsahab56
    @arainsahab56 3 ปีที่แล้ว

    Respect for your knowledge you are really talented man and you wisely tells us synchronization or a synchronization its suberp

  • @abbas6422
    @abbas6422 3 ปีที่แล้ว

    You had a great experience with this great type of generator in this episode

  • @mrliyon3585
    @mrliyon3585 3 ปีที่แล้ว

    Thank you for telling me about these functions. You have told us a very good thing. 🤗🤗🤗

  • @petrose5987
    @petrose5987 3 ปีที่แล้ว

    The episode proved to be very sorry for me. I learned a lot from this episode, thank you very much, you made this kind of video. 💜💜💜

  • @mominsahib5639
    @mominsahib5639 3 ปีที่แล้ว

    The features of generator it's functions are awesome and its streams are very fun.

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

    Congrats for the great explanations. Very nice and useful series.

  • @watson9780
    @watson9780 3 ปีที่แล้ว

    done a lot of excellent things about the generated function

  • @humshrifloghain9206
    @humshrifloghain9206 3 ปีที่แล้ว

    Excellent brother very good Generator function plan has with very good thinking

  • @alexanderg1911
    @alexanderg1911 3 ปีที่แล้ว

    Learning codes is my hobby i love this lesson

  • @Shahidkhan-wl1ls
    @Shahidkhan-wl1ls 3 ปีที่แล้ว

    You have done very well about the generator function 👏👏👏

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

    Hi there, Andrew Thanks great lesson, I usually use generators with BLoc design pattern

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

    Dart is brilliantly designed.

  • @unsoughtmelody
    @unsoughtmelody 5 ปีที่แล้ว +7

    At 4:28 you mentioned that the function turned into quadratic, but I don't see that.
    You still call the recursive function in either case once (linear). Using the yield* over the for loop seems to be just a syntactic sugar. You have to iterate through the recursive function's values in either case, yielding all values one by one eventually. Doing that with a yield* or for loop does not seem to make a difference.
    I wish you would have elaborated this further, otherwise great video!

    • @patricknasc
      @patricknasc 4 ปีที่แล้ว +1

      Perfect comment. I just noticed the same! And got confused with the explanation at this point!

  • @Euquila
    @Euquila 3 ปีที่แล้ว

    My heart just fluttered in anticipation of using a generator

  • @freeitcoder20
    @freeitcoder20 3 ปีที่แล้ว

    Flutter is genious technology for mobile development! I believe it is a future of mobile development!

  • @smackdown6836
    @smackdown6836 3 ปีที่แล้ว

    Its features and streams are amazing.

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

    Thanks for sharing. After watching it, I have just one question, why is in the fetchDoubles function with async the yield* without await?

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

    yield can be thought of as combination of return and continue

  • @anshulsinghla998
    @anshulsinghla998 5 ปีที่แล้ว

    Awesome stuff. Big thanks to Andrew

  • @balaganesh3440
    @balaganesh3440 4 ปีที่แล้ว

    bam it! that's great a series! we're the dart rockstars! repeat after me...

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

    Thank You!

  • @willium3196
    @willium3196 3 ปีที่แล้ว

    Final episode of generated function about flutter dart so well

  • @hencock1036
    @hencock1036 3 ปีที่แล้ว

    Your features are awesome And intrusted

  • @ve3dy
    @ve3dy 5 ปีที่แล้ว +12

    Hey, i want that Flutter T-Shirt how do i get it? 🤣

  • @iwandepee
    @iwandepee 3 ปีที่แล้ว

    i fell elightened with this series (:

  • @dreamfightersbn
    @dreamfightersbn 5 ปีที่แล้ว +1

    Thanks for this Flutter team.
    but i got distracted looking at Andrew's hair flopping down slowly
    just want to stick it back up

  • @khamidjonkhamidov3759
    @khamidjonkhamidov3759 3 ปีที่แล้ว

    Amazing guy and video. Thank you!

  • @Malik254ke
    @Malik254ke 3 ปีที่แล้ว

    both codes look similar this why i love coding

  • @realvideo7287
    @realvideo7287 3 ปีที่แล้ว

    This episode is very good for generator function, I am interested in it in net function ❤

  • @tractor8885
    @tractor8885 3 ปีที่แล้ว

    I feel great generator function is very important for me 😍😍

  • @pradeep422
    @pradeep422 5 ปีที่แล้ว +5

    3:00 why dont we hav this in dart docs lol...(so clear)

  • @loodyyehe5332
    @loodyyehe5332 3 ปีที่แล้ว

    What about generators and filters? Introduced to us your best and best kind. Very interesting in Urdu.

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

    Thanks :D this was great

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

    6:08
    So, the yield* in async method doesnt need await keyword ?

  • @magicianam1563
    @magicianam1563 4 ปีที่แล้ว +1

    Is there anyway to get more deep information about async* / sync* / yield / yield*

  • @blank-vw2sb
    @blank-vw2sb 4 ปีที่แล้ว +1

    I haven't even heard of generator functions before. I want all the type of things that I can do with dart. Is there a catalog?

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

    anyone know where I can get the Dart Side sticker or any flutter skicker's for my laptop

    • @Iapicca83
      @Iapicca83 5 ปีที่แล้ว

      www.redbubble.com/people/rimek/works/25315114-dart-programming-language?cat_context=all-stickers&grid_pos=41&p=sticker&rbs=4dcde76b-0b9f-4555-9f59-3343c542650e&ref=shop_grid&searchTerm=dart

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

    Since Andrew said he used async generator function only once in last year, so I think it's safe to say that he don't use BLoC pattern while creating flutter apps. So what's your favorite state management pattern, Andrew? :)

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

    Is the animation in this video also produced by Flutter?

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

    Impressive.
    await Future :)

  • @liorocker1
    @liorocker1 5 ปีที่แล้ว

    Now, I feel realized as an async dev... Thank you :)

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

    very nice

  • @mwk240
    @mwk240 5 ปีที่แล้ว

    What would be a use case for a synchronous generator? I can understand the use case for async.

  • @nabil.hamawi
    @nabil.hamawi 2 ปีที่แล้ว

    THANKS

  • @spacecapitalism7152
    @spacecapitalism7152 5 ปีที่แล้ว +1

    Flutter + GO ain't a bad combo.

  • @ooow333
    @ooow333 4 ปีที่แล้ว

    Interesting. Reminds me of the Python generator.

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

    I'm not sure that how the recursive functions stops, someone could explain me?
    Iterable getRange1(int start, int finish)
    sync*{
    if (start

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

      When start > finish. The generator stops automatically since no more yield element and function exit

  • @danvilela
    @danvilela 5 ปีที่แล้ว +1

    Wow, this was awesome! I read the docs but couldn't understand it. This video cleared up my head pretty good! Thank you Flutter Team, you're awesome. Just one question though, the yield* have a name? I mean, what does it "actually" do, putting it into words?

  • @ilyassnabbar5633
    @ilyassnabbar5633 3 ปีที่แล้ว

    A bit off subject but please enlighten me, Is it safe to say that an Iterator defines the way that an Iterable is Iterated ?

  • @kapowrobot7942
    @kapowrobot7942 3 ปีที่แล้ว

    Conceptually, everything is either a Iterable or Stream.
    Var X=0;
    I just created an infinite Interable that will always return 0;
    "single values" I see as one-shot Iterable or stream. after first request they become empty.
    Also is there a class that wraps around Stream that provides caching of future, so not every request needs to be a JIT execution? I guees easy enough to make one.

  • @prabhatlamichhane8505
    @prabhatlamichhane8505 12 วันที่ผ่านมา

    THAT one piece of hair tho !!!

  • @m.gundzi4400
    @m.gundzi4400 3 ปีที่แล้ว +1

    I want to know about Generated Junction Flutter Infocus in a very good way

  • @RobertWildling
    @RobertWildling 5 ปีที่แล้ว

    Future (int val) { sleep(const Duration(seconds: 5)); return val * 2; } won't work, because the return type is not of type Future. How can this be solved?
    Thanks for this video!

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

    I know how to do it, because I am a Dart Rockstar!

  • @sirx5x
    @sirx5x 4 ปีที่แล้ว

    Thnx you!!!!!

  • @kikikukudu61
    @kikikukudu61 5 ปีที่แล้ว

    0:44 jumpcut! :p

  • @heysuvajit
    @heysuvajit 4 ปีที่แล้ว

    Will any one tell me what is the best use case for generators?

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

    So yield* is only used in recursive code? Somehow recursive functions always make my heart palpitate with fear :D

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

      No. You don't get the point.
      yield* is syntactic sugar for iteration over another generator and yield each element of that generator

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

    So like a C static?

  • @shaikhsaiofali8432
    @shaikhsaiofali8432 5 ปีที่แล้ว

    How to paginate stream builder? Help

  • @namo5570
    @namo5570 5 ปีที่แล้ว

    I love you

  • @akhilez
    @akhilez 5 ปีที่แล้ว

    Flutter is how mobile development should've always been

  • @mkumar8210
    @mkumar8210 5 ปีที่แล้ว

    Please make video on chat app

    • @guledali8902
      @guledali8902 4 ปีที่แล้ว

      He is my brother
      These Concepts are all for Chat apps😂😂😂😂😂😂

  • @shashankvats2523
    @shashankvats2523 3 ปีที่แล้ว

    This similar to python iteration protocol

  • @dr.watson8418
    @dr.watson8418 3 ปีที่แล้ว

    Intrusting python generator

  • @Davti555
    @Davti555 5 ปีที่แล้ว

    where are all the haters? :o

  • @MuhammadUmair001
    @MuhammadUmair001 5 ปีที่แล้ว

    excuse me sir
    i have a problem while installing flutter: i m not b abale to adjust path for flutter in window 8.1 ...??? will u kindly help me ????

    • @heysuvajit
      @heysuvajit 4 ปีที่แล้ว +1

      Wrong place to ask :P

  • @zubairafzal6196
    @zubairafzal6196 3 ปีที่แล้ว

    I DIDN'T UNDERSTAND

  • @lexibigcheese
    @lexibigcheese 5 ปีที่แล้ว

    so basically it's yield instead of addokeverybody can go now.

  • @mrjsue77
    @mrjsue77 3 ปีที่แล้ว

    Thank you for telling me about these functions. You have told us a very good thing. 🤗🤗🤗