How to use StreamController and StreamBuilder in Flutter | Dart Stream Explanation | Hindi

Поділитися
Вставка
  • Опубліковано 26 сер 2021
  • Sign up for 10,000 free minutes: bit.ly/3jyzOPl
    Find out more about ZEGOCLOUD: bit.ly/3VFR96F
    How to build video call app: bit.ly/3WLEbVO Instagram: / rohitsemriwal
    Hey, in this video we will be taking a look at Streams in Flutter/Dart. This video is not meant for the people looking for advanced stream knowledge. This is focused completely on the beginners.
    This video will help you in understanding things like:
    1. How to use StreamBuilder in Flutter?
    2. What is a StreamController?
    3. How to use Streams in Flutter?
    Subscribe to the channel so you don't miss out on any future updates. Also, DM me on Instagram if you wanna learn 1 on 1 from me:
    Instagram:
    @rohitsemriwal
    / rohitsemriwal
    See you guys in the next one ;)
  • Розваги

КОМЕНТАРІ • 89

  • @jontysingh4334
    @jontysingh4334 2 роки тому +5

    Everything is fine but one thing is missing stream close karna reh Gaya , stream close karna is necessary so we don't face any memory leaks problem

    • @RohitSemriwal
      @RohitSemriwal  2 роки тому +4

      Great observation! I'll pin this comment for everyone to see 😁.
      But when using a StreamBuilder, it closes its associated stream automatically when the widget is removed from the widget tree.

  • @SAURABHGUPTA_DINOSAUR
    @SAURABHGUPTA_DINOSAUR 2 роки тому +2

    yaar kasam se yar bhai itne jada basic se explain karna sab ki baat nahi hai. Yaha youtube pe jo tutorials hote hai, woh toh aise explain karte h jaise apne ko sab pata hi hai. But kudos to you mahn. keep it up!!

    • @RohitSemriwal
      @RohitSemriwal  2 роки тому +1

      Thanks a lot, glad you like my content 😁

  • @khubaibirfan9215
    @khubaibirfan9215 Рік тому

    Sir ap jesa pore UA-cam mai koi ni parha skta.sir ap legend hain❤️❤️❤️

  • @shreypandit4540
    @shreypandit4540 Рік тому

    Very nice explanation 👌 👍 👏 😀

  • @KevalMotisariya-cs3gh
    @KevalMotisariya-cs3gh Рік тому

    Mind blowing explaination

  • @cosif3001
    @cosif3001 2 роки тому +2

    One of the cleanest tutorial on youtube, must be appreciated

  • @mondal1839
    @mondal1839 Рік тому

    Best explanation. Finally understood.

  • @VikashYadav-zo4gu
    @VikashYadav-zo4gu 10 місяців тому

    well explained Rohit

  • @sabinkc7276
    @sabinkc7276 Рік тому

    You got the amazing teaching ability😘

  • @Abhishekyadav-mg5vu
    @Abhishekyadav-mg5vu 2 роки тому +3

    Searching this explanation from a long a time,..far far better than any video comes in top searching section , you deserve to get much more reach then you're getting right now, by the way you for this tutorial

  • @morshedraiankhan6968
    @morshedraiankhan6968 2 роки тому

    Thanks helpful video for learning stream

  • @imranakbarofficial452
    @imranakbarofficial452 Рік тому

    brother, your method is soo nice❤❤

  • @RahulKumar-kg3hu
    @RahulKumar-kg3hu Рік тому

    Great job 👍

  • @kamalCode
    @kamalCode 2 роки тому +2

    Sir, please flutter bloc advanced tuotorial hindi

  • @akshayvqube9626
    @akshayvqube9626 2 роки тому

    really helpful video explanation and coding thanks keep the good videos on other topics in flutter

    • @RohitSemriwal
      @RohitSemriwal  2 роки тому

      Glad you liked the video! I'll keep on creating more and more helpful content 😁

  • @mayur16
    @mayur16 2 роки тому

    thank you so much ..

  • @Trendspra
    @Trendspra Рік тому

    Well explained

  • @30vijaytyagi9
    @30vijaytyagi9 9 місяців тому

    Thank You Sir

  • @MehediHasan-cc4hz
    @MehediHasan-cc4hz Рік тому

    The way you describe in details is really good.Thank you

  • @Anom21
    @Anom21 2 роки тому

    really good video. Enjoyed watching!!

  • @JAY-bo7tg
    @JAY-bo7tg 2 роки тому

    Thank you so much for easy explanation..
    Keep doing

  • @vivekprasad2703
    @vivekprasad2703 2 роки тому +3

    Love the way your are Explaining. thank you so much. Can you also explain Provider in depth with projects ?

    • @RohitSemriwal
      @RohitSemriwal  2 роки тому +2

      Thanks for the compliment 😁, will try to do a video on Provider soon.

    • @mudassarali458
      @mudassarali458 2 роки тому +1

      @@RohitSemriwal Yes sir please explain provider with real time projects

  • @amansingh.h716
    @amansingh.h716 2 роки тому +1

    bro keep it up nice explantaion

  • @abdulrehmananwar6990
    @abdulrehmananwar6990 2 роки тому

    prefect want this from long time many many thanks.

  • @saiham4500
    @saiham4500 Рік тому

    it works if i do controller.add(newData)
    what is the difference when using controller.sink.add(newData)
    Please explain

  • @designer-developer3886
    @designer-developer3886 2 роки тому

    Such a nice explanation ❤❤

  • @ajaykotiyal427
    @ajaykotiyal427 2 роки тому

    Well Explained. thankx for sharing.

  • @piyushgoyal6219
    @piyushgoyal6219 2 роки тому

    its really helpful video.I learned a lot.Please upload videos on rxdart and services and notifier

    • @RohitSemriwal
      @RohitSemriwal  2 роки тому

      Thanks a lot 🙏 I'll take your ideas into consideration 😁

  • @wanttobecoder7771
    @wanttobecoder7771 Рік тому

    Sir streamcontroller.add() and streamcontroller.sink.add() me kya difference he kaam toh dono hi kr rha he but difference nhi samjha.
    pls reply

  • @madmilitiangaming5694
    @madmilitiangaming5694 Рік тому

    nice video

  • @uveshsiddiqui2477
    @uveshsiddiqui2477 2 роки тому

    Great content💥💥💥💥

  • @somnathdas8922
    @somnathdas8922 2 роки тому

    Sir awesome explained ❤️💯

  • @kamalCode
    @kamalCode 2 роки тому

    Plz all video in playlist.

  • @moizrehman791
    @moizrehman791 Рік тому

    Very nice explaination

  • @97016580
    @97016580 2 роки тому

    I need a video for stream builder where we get data from the API.

  • @pheonixway8029
    @pheonixway8029 Рік тому

    nice explanation bro

  • @kamalCode
    @kamalCode 2 роки тому +2

    Dart single subscription, Broadcast stream in depth explain Hindi

    • @kamalCode
      @kamalCode 2 роки тому +1

      Please upload video tomorrow, very hard topics

  • @Physics3333
    @Physics3333 2 роки тому

    simple explaination super

  • @hiraamirbux6178
    @hiraamirbux6178 9 місяців тому

    Hi, where can i get the code ?

  • @thinkGrey_
    @thinkGrey_ 2 роки тому

    Helpful

  • @khubaibirfan9215
    @khubaibirfan9215 Рік тому

    ❤️❤️❤️❤️❤️

  • @abdulrehmananwar6990
    @abdulrehmananwar6990 2 роки тому

    i am facing one error (stream has already been listened to) in TabBarView on change of tab and return back to tab please provide a solution thanks

    • @saiham4500
      @saiham4500 Рік тому

      you need to use brodcast stream to have multiple listener/subscriber

  • @rashidulislam1183
    @rashidulislam1183 2 роки тому

    thanks

  • @mustufashahid646
    @mustufashahid646 Рік тому

    Hi sir, can you tell me how to dispose the streams? I'm facing an issue, developing an e-commerce app, updating my profile information but when I logout and then login from another user, it shows the previous user's profile info, and someone told me to dispose the streams, can you please help me in this regards or provide any reference for this solution.

    • @RohitSemriwal
      @RohitSemriwal  Рік тому +1

      If using a streambuilder, the streams will be disposed automatically.
      But if not using a StreamBuilder you can store the streamsubscription as a variable and then cancel it later.
      StreamSubscription subs = newStream.listen(handle);
      Then whenever you want to cancel it:
      subs.cancel()

    • @mustufashahid646
      @mustufashahid646 Рік тому

      @@RohitSemriwal yes sir i'm using streamBuilder( ... ) but whenever I log out and again login with some other user profile it is showing the older one profile information, then what can be the issue according to your knowledge?

  • @abdulrehmananwar6990
    @abdulrehmananwar6990 2 роки тому

    i have change StreamController() to StreamController.broadcast(); which resolved my issue.let me know please is this a right way?

    • @RohitSemriwal
      @RohitSemriwal  2 роки тому +1

      Yes, broadcast streams can be listened to more than one time.

    • @abdulrehmananwar6990
      @abdulrehmananwar6990 2 роки тому

      Sir i am using tabview its not refresh stream when i change tab

    • @abdulrehmananwar6990
      @abdulrehmananwar6990 2 роки тому

      I use two tabs both tabs contains same stream when i update stream and change the tab then new tab dont show updated stream

  • @keteretsu9252
    @keteretsu9252 2 роки тому

    This explanation
    Damn man m sweating 🥵
    Thank you

  • @Js-Lovers
    @Js-Lovers 2 роки тому

    can you help me for StreamProvider?

    • @RohitSemriwal
      @RohitSemriwal  2 роки тому +2

      What's the issue?

    • @Js-Lovers
      @Js-Lovers 2 роки тому +1

      @@RohitSemriwal i don't know how to use that

  • @pankajkhairnar621
    @pankajkhairnar621 Рік тому

    Good... but background music is very disturbing...

  • @TrikNgonlen
    @TrikNgonlen 2 роки тому

    It would be better if it is in English... ^_^

    • @RohitSemriwal
      @RohitSemriwal  2 роки тому

      I'm planning on making a channel in English as well, will notify you when it's done. Thanks for watching 😁

  • @Medos996
    @Medos996 2 роки тому

    Can you please not put an english title to a video that is in hindi?

    • @RohitSemriwal
      @RohitSemriwal  2 роки тому +1

      The title clearly says Hindi at the end. Also I select language Hindi while uploading the video.
      Also the thumbnail mentions that the video is in Hindi.
      I get what you're saying and sorry for any inconvenience caused.