Dart Streams - Flutter in Focus

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 มิ.ย. 2019
  • This is the third video in the Flutter in Focus series on asynchronous coding in Dart. In this episode, learn about the fundamentals of reactive coding with streams. Like futures, streams deliver data asynchronously, but while a future provides a single value and stops, stream keep right on going, and provide multiple values (or errors!) over time.
    For more deep dives on things like Stateless and Stateful widgets, Flutter on iOS, and other advanced topics, check out the other episodes of Flutter in Focus.
    Asynchronous programming: Streams → dart.dev/tutorials/language/s...
    Flutter in Focus Playlist → goo.gle/FlutterInFocus
    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

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

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

    These videos are really helpful. Please keep making more of this useful content. I am starting to love flutter/dart more and more.

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

    I just love Andrew so much. His presentation is always clean and straight to the point. Thanks man!

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

    This video is incredibly didactic. Clear, concise, and complete. Thank you!

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

    The whole team involved in the creation of these videos should be very proud of themselves. These videos are amazingly easy to follow and understand.
    Well done.

  • @mahmud-ahsan
    @mahmud-ahsan 5 ปีที่แล้ว +7

    Elegant way to describe the stream and related features. Thank you.

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

    Really awesome widgets of flutter. Streams concept is very nice.

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

    Awsome as always. One of the world's best teacher. To the Point.

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

    If it wasn't for these videos, I wouldn't consider Dart. Thank you, Andrew.

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

    Actually masterfully explained.

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

    daaaaaaamn 👌🏼 i just used the streambuilder before that video, but the where and map functions are helping me a lot here 👌🏼

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

    Great video! Thanks for the clean and simple explanation.

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

    Very nice presentation, easy to understand and with helpful visuals for each step. Thanks.

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

    This literally helped me solve a problem I have been stuck on for 3 hours, thanks

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

    so good rubric, thank you so much for your work

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

    Thanks so much, fantastic content.
    Greetings from Brazil.

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

    the redux part (which can avoid the use of == overwriting in some cases) and the stream controller was amazing!

  • @hanifshahy4622
    @hanifshahy4622 7 หลายเดือนก่อน +1

    Thanks alot! in this video I found how to solve `Bad state: Stream has already been listened to.` error.

  • @dam.s
    @dam.s 3 ปีที่แล้ว +1

    Excellent presentation, superb video.

  • @hanifshahy4622
    @hanifshahy4622 7 หลายเดือนก่อน +1

    This video worths ten times to watch.

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

    One of the best intro for Streams.

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

    Nice Explanation. Thank you

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

    Great explanation. Thx !!!

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

    This videos are so good!

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

    Fantastic. Thankful.

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

    You're killing it

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

    Great Post !!! Beautiful t-shirt

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

    Thank you for the information, sir

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

    I love this videos, I so helpful

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

    that's incredible clear!

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

    너무나 유익한 강의 감사합니다!

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

    Very Helpful

  • @MohamedAli-vr9mw
    @MohamedAli-vr9mw 3 ปีที่แล้ว

    This man should get Oscar in explaining difficult topics

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

    Could these explanations be any more simpler!! Just awesome 🔥🔥

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

    thank you Sir.

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

    This is so helpfull thanks

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

    awesome!!!

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

    VERY clear and helpful :) Thank you!

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

    great video

  • @nahideducational
    @nahideducational 8 หลายเดือนก่อน

    nice explanation

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

    Thanks a lot for your explanation of Stream. It seemed hard at first, but a bit later it has become very clear.

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

    Nice, really nice.

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

    thank u bro

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

    thank you

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

    Great video :) thanks for sharing. Knows someone where I get that flutter / dart shirt?

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

    very nice

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

    LOVE RXDART

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

    I should fall in love with Dart Streams.

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

    thanks

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

    is it possible to "stream" videos from youtube v3 api? or does it only support gets?

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

    Great video, but how can I compare between streams in unit testing?

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

    Dart is so elegant man.

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

    very good video, more real life examples would be great though

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

    How would you receive and transmit to a Socket coming from a particular IP and port?

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

    Muy util

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

    These videos make google technologies take over so fast

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

    🚀💯

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

    I tried the stream, but I could use the streamController the add data, why do we need the sink to add data?

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

    Anyone can recommend similar great tutorials on Dart 2?

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

    Streams are used for what any example please?

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

    I have a nested firebase collection in my flutter app . I want to listen to the inner collection. How can I achieved that with a stream builder.

  • @user.wioelogj3
    @user.wioelogj3 5 ปีที่แล้ว +3

    Hi Andrew, thank you for videos on this topic! I have a question. Does StreamController consume a lot of resources? Is it okay to have like several hundreds, maybe one thousand of active controllers in a mobile app?

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

      Dart is an open source language, so you can actually see the code for StreamControlle: github.com/dart-lang/sdk/blob/master/sdk/lib/async/stream_controller.dart
      It's built for efficiency, certainly, though I've never tried more than a dozen or so controllers at once in an app. You should consider building one yourself with a thousand StreamControllers just to see how well it performs, and then post the results on GitHub. :)

    • @user.wioelogj3
      @user.wioelogj3 5 ปีที่แล้ว +1

      @@andrewbrogdon558 Thank you!

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

    I'm trying to implement a stream as a number showing up in a container, are there any tutorials on this?

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

    Thank you very much for the video, very explanatory, but I have a doubt:
    I always initialize the Future / Stream objects in initState, to prevent them from being recreated every call of the build method, in the video I notice that the functions that return Future / Stream theoretically are called inside the build method, thus creating these objects with each build, what would be the best way to use it?

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

      Hi Rully! If I understand your question correctly, one approach to prevent the Future from firing in every build is to use AsyncMemoizer. Check this link: medium.com/saugo360/flutter-my-futurebuilder-keeps-firing-6e774830bc2

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

      Great question. In these videos, we're often forced to shorthand some things and/or leave out details in order to get the code down to a size that actually fits on the screen (see 7:12 for an example of how hard this can be). As a result there are times when we show something like the FutureBuilder at 6:38 that looks like it's initializing a new network request on every build. That wouldn't be a good practice, but the point of that slide is mostly just to show that FutureBuilder takes a Future and a builder, and anyone who sees the name "_fetchNetworkData" can hopeful recognize it as a stand-in for something more sophisticated.
      That said, you're completely correct that under normal conditions, you don't want to be creating Futures in a build method. Flutter expects build methods to be fast and side effect free, because it needs to be able to call them often (sometimes in ways that can be surprising -- try tracing the builds caused by a Navigator pushing and popping routes some time). As a result, if you're actually *creating* a Future or Stream, it's probably best done in a State object's initState, a class held by an InheritedWidget, or something like that.

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

    any suggest to dive into deep stream projects and understand more ?

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

    how to stop the subscription of a stream of a singleton class, and when re-creating the subscription do not continue the data of that stream.

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

    So to understand it better : A Stream is typically a List of Asynchronous Operations or values right ?

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

      I usually compare streams to iterators, because both of them provide values in sequence and don't let you backtrack. It sounds like you've got the idea though: a stream is just a thing that can provide multiple values over time, asynchronously.

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

    I am using background location, from the location callback I am adding the stream but even though the app is in foreground the listener is not working. How to send data/trigger from background location callback to foreground screen

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

    Flutter for the fucking win bro!

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

    You are intelligent

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

    I think It is like IAsyncEnumerable in C#.

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

    Where can I get that shirt?!

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

    i am not getting how to use "asBroadCastStream" , I can't find any proper example regarding that.

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

    You said that the `cancelOnError` is true by default. Looks like it is false by default, which is quite important to remember about :)

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

      That's what the official documentation is for. This person is just using his free time and effort, to explain in detail FOR FREE for people that are lazy to learn by themselves, so, it's totally valid that they could confuse some things at times. It's your responsibility to read the manuals, instructions, etc. And even sometimes, instructions have errors/mistakes, because we are humans, we make mistakes. So if you find something wrong, you have the responsibility of KINDLY letting them know to fix it, not being all entitled and offended because "the teacher dared to make a mistake".

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

      @@AngelHdzMultimedia Take it easy man. I just mentioned the mistake so others can see that or the author could add an annotation to the video. I can't see anything unkind or offending here. I'm not a native english speaker though so let me know what is wrong :)

  • @GurdeepSingh-gr7fb
    @GurdeepSingh-gr7fb 5 ปีที่แล้ว +3

    Greetings to all flutter Developers here.

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

    Coming from Angular world, are there any advantages to using pub.dev/packages/rxdart ?

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

    i create Stream to listen notification and i want to send reply to those notification how i am suppose to do that?

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

    This is revolution, I mean, hard to achieve otherwise kind off things, done so easily.. but who is behind these all scenes.. google? then I doubt, it will all get monetised, some days.. for sure

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

    how do you dispose a stream??

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

    Why not use `switch case` in ConnectionState?

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

      I think better following.
      switch (snapshot.connectionState) {
      case ConnectionState.waiting:
      ...
      case ConnectionState.done:
      ...
      default:
      ...
      }

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

    How do these guys know all this stuff!!!

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

      BECAUSE THEY MADE IT.... :-P

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

      Because they used their time and effort to understand Object Oriented Programming, and read the official documentation...

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

    why use rxdart then?

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

    What is the point of Kafka when you master these ?

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

      when no clustering is there

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

    กรูนี่โคตรโง่ภาษาอังกฤษเลย ใครก็ได้มอบทุนไปเรียนภาษาอังกฤษให้กรูที Please... Love Flutter. This is My Frist Language programing on mobile app. 555 ฮิ้ววววว

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

    Clearly its like traditional nodejs Stream event architecture just the names are different & with some sugary methods & syntax.
    nodejs: stream.on(eventname: "data"|"error"|"finish"|"pipe"|....so on, callback);
    dart: stream.listen((data)=>void, onError: (err)=>void, onDone: ()=>void, .... so on);

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

    why is this unlisted? :(

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

      We upload files a few days early so our translation team can access them to create captions and subtitles. This one was accidentally added to the Flutter in Focus playlist before its real release date, which (I'm guessing) is how you found it. Do me a favor and don't tweet the link for a few days. :)

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

      @@andrewbrogdon558 pretty sure he didn't tweet it

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

      @@andrewbrogdon558 Thank you very much

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

      @@andrewbrogdon558 Ok

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

    4:41

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

    Rxjs like

  • @NishaSharma-hd6qw
    @NishaSharma-hd6qw 5 ปีที่แล้ว

    Could you please make a demo for playing DRM(encrypted) videos with flutter

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

    Lessons for the kids, I knew that from the web)

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

    Does anyone know why `sink` is called `sink`?
    Edit: found this en.wikipedia.org/wiki/Sink_(computing)

  • @marana.th4
    @marana.th4 2 ปีที่แล้ว

    3:10

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

    I want to build an app that fetches my current location value even if the user is not using the app and matches the current location value with the location value stored in the DB and then do some task (all things are done in the background). How can I do that in flutter? Pls, anyone help me...

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

    This is Called Channels in Elixir😅😅😅

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

    stupid to put in an example that is not repeatable because the stream method creates an error in dartpad.

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

    luca

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

    Music in tutorials is a big nono. Even if it is just for a few seconds in the beginning of a video

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

    ?Donde está el código completo y funcionando para poder entenderlo?
    ?Porqué los tutoriales y manuales de Flutter son tan incompletos y confusos al punto de ser inservibles?
    Este tema que debería ser simple, como actualizar las respuestas de las Class y sus datos almacenados es inentendible por culpa de los malos tutoriales e información confusa sin ejemplos que funcionen , .
    Ni siquiera encuentro un ejemplo en la web sin error....
    Mi sensación es que Flutter es de esas cosas gubernamentales que deberían ser simples, pero la casta de burocratas las hacen inentendibles, salvo para ellos.
    Pensar que Google vive de facilitar informaciones, parece un mal chiste....

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

    thanks