Dart Streams - Flutter in Focus

Sdílet
Vložit
  • čas přidán 27. 06. 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

Komentáře • 116

  • @thijsoudeavenhuis999
    @thijsoudeavenhuis999 Před 5 lety +166

    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 Před 5 lety +79

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

  • @Mabidakun
    @Mabidakun Před 3 lety +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.

  • @viniciusqueiroz2713
    @viniciusqueiroz2713 Před 2 lety +5

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

  • @mahmud-ahsan
    @mahmud-ahsan Před 5 lety +7

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

  • @CprkMagicMoves
    @CprkMagicMoves Před 5 lety +13

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

  • @bikkikumarsha
    @bikkikumarsha Před 4 lety +4

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

  • @rebarius
    @rebarius Před 5 lety +4

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

  • @joelgimenez
    @joelgimenez Před 4 lety +19

    Actually masterfully explained.

  • @Lamarsh67
    @Lamarsh67 Před 4 lety +1

    Great video! Thanks for the clean and simple explanation.

  • @marcoantonio7648
    @marcoantonio7648 Před 3 lety

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

  • @gamedeathmatch
    @gamedeathmatch Před 2 lety

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

  • @WilsonSilva90
    @WilsonSilva90 Před 4 lety +8

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

  • @paralysekid
    @paralysekid Před rokem

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

  • @hanifshahy4622
    @hanifshahy4622 Před 8 měsíci +1

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

  • @kos9k46
    @kos9k46 Před 5 lety +3

    so good rubric, thank you so much for your work

  • @MyGarvas
    @MyGarvas Před 4 lety

    Thanks so much, fantastic content.
    Greetings from Brazil.

  • @dam.s
    @dam.s Před 3 lety +1

    Excellent presentation, superb video.

  • @jaanaan143
    @jaanaan143 Před rokem

    One of the best intro for Streams.

  • @MohamedAli-vr9mw
    @MohamedAli-vr9mw Před 3 lety

    This man should get Oscar in explaining difficult topics

  • @hanifshahy4622
    @hanifshahy4622 Před 8 měsíci +1

    This video worths ten times to watch.

  • @dmitriiegorov1888
    @dmitriiegorov1888 Před 4 lety +1

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

  • @chandranathgupta4500
    @chandranathgupta4500 Před 4 lety

    Nice Explanation. Thank you

  • @maxan2121
    @maxan2121 Před 3 lety

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

  • @jagdishshetty4782
    @jagdishshetty4782 Před 3 lety

    Great explanation. Thx !!!

  • @abou3542
    @abou3542 Před 5 lety

    Great Post !!! Beautiful t-shirt

  • @baskee
    @baskee Před 5 lety

    This videos are so good!

  • @akhilrajnambiar2080
    @akhilrajnambiar2080 Před rokem

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

  • @HandikaHarisaputra
    @HandikaHarisaputra Před 4 lety

    Thank you for the information, sir

  • @batuhankrbb
    @batuhankrbb Před 3 lety

    You're killing it

  • @josiahsaunders4936
    @josiahsaunders4936 Před 4 lety +2

    VERY clear and helpful :) Thank you!

  • @brianl6329
    @brianl6329 Před 2 lety

    Fantastic. Thankful.

  • @fabianosantana6052
    @fabianosantana6052 Před 5 lety +1

    I love this videos, I so helpful

  • @yuchen52
    @yuchen52 Před 3 lety

    that's incredible clear!

  • @saqib399
    @saqib399 Před 2 lety +1

    Very Helpful

  • @rezaasgary1442
    @rezaasgary1442 Před 5 lety

    This is so helpfull thanks

  • @nahideducational
    @nahideducational Před 9 měsíci

    nice explanation

  • @tawsan646
    @tawsan646 Před 3 lety

    thank you Sir.

  • @FlutterExplained
    @FlutterExplained Před 5 lety +1

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

  • @valentingarcia2246
    @valentingarcia2246 Před 3 lety

    great video

  • @GeekyGagan
    @GeekyGagan Před 5 lety

    awesome!!!

  • @zurabn1281
    @zurabn1281 Před 3 lety

    Nice, really nice.

  • @jakubiwanicki8884
    @jakubiwanicki8884 Před 2 lety

    thank u bro

  • @ehsanhasin8092
    @ehsanhasin8092 Před rokem

    thank you

  • @heshansandeepa9471
    @heshansandeepa9471 Před 2 lety +1

    very nice

  • @fethisert5527
    @fethisert5527 Před rokem

    thanks

  • @juanmamani2110
    @juanmamani2110 Před 2 lety

    I should fall in love with Dart Streams.

  • @alexneeky7920
    @alexneeky7920 Před 5 lety

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

  • @hossameldinmahmoud5768
    @hossameldinmahmoud5768 Před 3 lety +1

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

  • @petrushoc
    @petrushoc Před 5 lety +1

    LOVE RXDART

  • @Build_the_Future
    @Build_the_Future Před 3 lety +2

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

  • @RaitonGG
    @RaitonGG Před 4 lety +1

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

  • @andreujuanc
    @andreujuanc Před 5 lety

    Dart is so elegant man.

  • @mikem7084
    @mikem7084 Před 4 lety +1

    These videos make google technologies take over so fast

  • @user.wioelogj3
    @user.wioelogj3 Před 5 lety +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 Před 5 lety +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 Před 5 lety +1

      @@andrewbrogdon558 Thank you!

  • @kirill4531
    @kirill4531 Před 5 lety +1

    Anyone can recommend similar great tutorials on Dart 2?

  • @ezequielpereira4160
    @ezequielpereira4160 Před rokem

    Muy util

  • @dhavalparmar9554
    @dhavalparmar9554 Před 4 lety

    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.

  • @emdadgar_official
    @emdadgar_official Před rokem

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

  • @kentthomas1045
    @kentthomas1045 Před 3 lety

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

  • @saguoran
    @saguoran Před 4 lety

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

  • @rullyalves7163
    @rullyalves7163 Před 5 lety +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 Před 5 lety

      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 Před 5 lety +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.

  • @AceHardy
    @AceHardy Před 4 lety

    🚀💯

  • @dhamodharanm1810
    @dhamodharanm1810 Před 3 lety

    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

  • @algeriennesaffaires7017

    Streams are used for what any example please?

  • @naderkhaled9410
    @naderkhaled9410 Před 5 lety +1

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

    • @andrewbrogdon558
      @andrewbrogdon558 Před 5 lety

      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.

  • @segundojaramilloromero9909

    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.

  • @shahidwani6445
    @shahidwani6445 Před 4 lety

    I think It is like IAsyncEnumerable in C#.

  • @josecoverlessons
    @josecoverlessons Před 4 lety

    Flutter for the fucking win bro!

  • @marcinadamczewski6067
    @marcinadamczewski6067 Před 5 lety

    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 Před 4 lety

      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 Před 4 lety

      @@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 :)

  • @codezero1015
    @codezero1015 Před rokem

    You are intelligent

  • @ViralVideoMalayalam
    @ViralVideoMalayalam Před 3 lety

    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

  • @mohitmodh5584
    @mohitmodh5584 Před 3 lety

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

  • @rajdipsarvaia6641
    @rajdipsarvaia6641 Před 2 lety

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

  • @TheChrist559
    @TheChrist559 Před 5 lety +6

    How do these guys know all this stuff!!!

    • @harshvardhan8190
      @harshvardhan8190 Před 4 lety +2

      BECAUSE THEY MADE IT.... :-P

    • @AngelHdzMultimedia
      @AngelHdzMultimedia Před 4 lety

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

  • @Digitaln8
    @Digitaln8 Před 5 lety

    Where can I get that shirt?!

  • @GurdeepSingh-gr7fb
    @GurdeepSingh-gr7fb Před 5 lety +3

    Greetings to all flutter Developers here.

  • @CodingCatDev
    @CodingCatDev Před 4 lety

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

  • @krtirtho
    @krtirtho Před 3 lety

    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);

  • @nanstay
    @nanstay Před 5 lety

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

  • @dennougorilla8861
    @dennougorilla8861 Před 5 lety

    Why not use `switch case` in ConnectionState?

    • @dennougorilla8861
      @dennougorilla8861 Před 5 lety

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

  • @balajir5736
    @balajir5736 Před 2 lety

    how do you dispose a stream??

  • @NishaSharma-hd6qw
    @NishaSharma-hd6qw Před 5 lety

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

  • @aben8763
    @aben8763 Před 4 lety

    What is the point of Kafka when you master these ?

    • @aben8763
      @aben8763 Před 4 lety

      when no clustering is there

  • @calpal101
    @calpal101 Před 2 lety

    4:41

  • @chrisik100
    @chrisik100 Před 5 lety +1

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

  • @walrider7374
    @walrider7374 Před 5 lety

    why use rxdart then?

  • @karlbooklover
    @karlbooklover Před 5 lety +1

    why is this unlisted? :(

    • @andrewbrogdon558
      @andrewbrogdon558 Před 5 lety +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 Před 5 lety

      @@andrewbrogdon558 pretty sure he didn't tweet it

    • @mahmoudbasuony3193
      @mahmoudbasuony3193 Před 5 lety

      @@andrewbrogdon558 Thank you very much

    • @Deliriummorphium
      @Deliriummorphium Před 5 lety

      @@andrewbrogdon558 Ok

  • @raprincis
    @raprincis Před 4 lety +1

    Rxjs like

  • @marana.th4
    @marana.th4 Před 2 lety

    3:10

  • @newpursuit1
    @newpursuit1 Před 3 lety

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

  • @sachinmittal65
    @sachinmittal65 Před 4 lety

    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 Před 4 lety

    This is Called Channels in Elixir😅😅😅

  • @maxwimmer8746
    @maxwimmer8746 Před 2 lety

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

  • @nichoyeah
    @nichoyeah Před 2 lety

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

  • @simonemonesi4961
    @simonemonesi4961 Před 3 lety +1

    luca

  • @alfredoqwe
    @alfredoqwe Před 2 lety

    ?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 Před 4 lety

    thanks