Flutter Quick Tip: Using the "mounted" property | Flutter Developers must Know

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ก.ย. 2024
  • #flutter #mounted #setstate
    In this Flutter Quick Tip Tutorial, we are going to take a look at using the "mounted" property which is absolutely essential to know for Flutter Developers. This can help you to prevent a lot of memory leaks in your Flutter Mobile Apps and help you solve the error such as setState called after dispose.
    👉 Flutter Docs: api.flutter.de...
    🔥 Auto-Generate Flutter Custom Paint Code TRY THIS FREE TOOL👇:
    👉 Flutter Shape Maker: fluttershapema...
    🔥 Learn About the Most Important Widgets in Flutter 👇:
    👉 Widget Essentials Series: bit.ly/3GpfiYw
    👉🏻 Product Hunt: www.producthun...
    (Your UPVOTE Means a lot! 🙌)
    If you find this video useful consider Supporting @RetroPortal Studio :
    👉 Buy Me a Coffee: www.buymeacoff...
    👉 Patreon: / retroportalstudio
    Social Links @RetroPortal Studio :
    👉 Twitter: / theretroportal
    👉 Medium: / retroportalstudio
    👉 Instagram: / retroportalstudio
    👉 Patreon: / retroportalstudio
    👉 GitHub: github.com/ret...
    If you like the tutorial, please hit the LIKE and Subscribe button and also consider supporting me on Patreon or Buy Me a Coffee for More Flutter Tutorial on RetroPortal Studio.
    Thank you for Watching! Happy Coding :)

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

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

    Those type of short videos adressing simple yet very common probelms are the most useful videos for developers, thank you

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

    Wooo I didn't know the override solution I always wrap setState into the condition , thanks so much man... Amazing explanation! 😍😍😍

  • @nateg617
    @nateg617 5 หลายเดือนก่อน +1

    Fantastic. Easy and clear. Thanks !

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

    one of the best channels , straight through , great topics , pure linear knowledge ... keep it up you are doing great

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

    Freaking Matrix. I saw your video yesterday and today I got this error for the first time!!! Awesome. Thanks man

  • @Amandeep-kq5bz
    @Amandeep-kq5bz 2 ปีที่แล้ว +5

    Perfect Explanation.

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

    Short, clear and very useful ! Perfect one here 👌

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

    Thank you so much, I've been getting this error for 2 days

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

    wow. Thank you. the for overriding setstate() was amazing closing note.

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

    You should create more of such content!

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

    Thanks for this amazing video, really a neat trick to override the setState, never knew that was possible.

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

    Thank you very much :D

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

    Learnt something useful today thanks.

  • @user-jchjkitv77896
    @user-jchjkitv77896 2 ปีที่แล้ว +1

    I always got this error 😃. Very helpful.

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

    Well explained

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

    Terimakasih Sharing videonya sangat bermanfaat salam sukses dan sehat selalu ya

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

    Short, clear and very useful ! Perfect one here

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

    I glad I've met you

  • @rahuljamba5846
    @rahuljamba5846 5 หลายเดือนก่อน +1

    Great topics

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

    To the point Solutions, Excellent work !!

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

    Very good and well explained. Thanks.

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

    thank you so much

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

    Very useful

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

    thanks!! useful and short.. like a shot of knowledge..in the middle of the brain hahaha

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

    I love your channel 💓

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

    Perfect as usual bro...thank you

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

    thank you, great tip!

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

    Thanks

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

    In this case, do we need to override within each class?
    Is there any way we can set it globally?

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

    Wonderful. Thank you for this helpful tip

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

    Thanks for the info!

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

    Thanks!

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

    Thank you so much bro for this❤❤

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

    Cool trick ! Thanks :)

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

    Bro Please restart making a new video. Your content is so good what flutter developer should to learn. Please make video on state management(Bloc, GetX, Provider....) on real life related project. And please comeback and make a video😪😪

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

    How would you cancel the api call instead in dispose /destroy method ??

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

    Great trick Thanks.

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

    Just what i needed :)

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

    Great Info.

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

    Super Information .👌👌👌

  • @acornerofherheart-jr9pl
    @acornerofherheart-jr9pl 3 หลายเดือนก่อน

    thank you

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

    So much helpfull 👏🙌

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

    why is not the defailt in flutter?

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

    Great tip! I didn’t know about this property

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

      I think we should add it on baseview widget of MVVM provider architecture when setting viewstate to busy or idle

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

      @@markdioneeb8997 We can add it but not for idle and busy. won't work for that

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

      @@FilledStacks noted, btw I thoroughly studied your awesome mvvm architecture the provider + getit version and still sticking to it even if there's already stacked package, I was overwhelmed with all the features I hope u can provide a working example of every feature of the package, a simple counter would be very helpful. Thank you.

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

      @@markdioneeb8997 Hey, i built 2 series of howto use stacked. it's exactly the same, and on the readme there's an example :)

  • @hi-s
    @hi-s 2 ปีที่แล้ว +2

    I knew it from andrea course animation master class

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

    Hallo Mr, i'm Roberto from jakarta,
    I am still a beginner who just wants to learn to be an Android application developer.
    I'm still confused. For example, if you make an Indonesian versus English dictionary application and other languages, or make a holy book, are the vocabulary lists or long verses written under the coding, like during UI design, or are they called from a special repository? because if a list of vocabulary words or a large number of verses from the holy book are inserted per sentence under the text wedges, it definitely requires a lot of page space.
    Can you please give a basic example of making a language dictionary or holy book application?
    I've been looking for it for a long time in the Indonesian Flutter programmer tutorial but haven't found a video that specifically explains my question.

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

    👍

  • @barnabassolomon1629
    @barnabassolomon1629 4 หลายเดือนก่อน

    never encountered this when i used bloc, im curious why

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

    Hello, can i use some library to edit my image(grayscale, split text in image) after i import it from ImagePicker library

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

    recently i saw it

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

    Why google developers did not add it in setState function default?

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

    Bhai flutter shape maker flutter web hai fir bhi fast load ho jata hai or mera flutter web project me release me bhi white screen aata hai initially 5-6 seconds.
    How to fix ?

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

    im facing same issue in statefulbuilder check for mounted variable as described in video is not working in statefulbuilder kindly make a video to solve same problem inside statefulbuilder

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

    why dont flutter make it a default behavior of setState?

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

    Hm, but why mounted isn't by default as wrapper of setState instead of overriding that?

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

    How to Check mounted in StatefulBuilder

  • @kalyanchandra4376
    @kalyanchandra4376 2 หลายเดือนก่อน

    Finally U didn't explain the what the exact mounted keyword will does?

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

    Where is the code

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

    why u r not uploading sir

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

    Hello bro plz upload a sales end 24 hours live timer video tutorials eg: Amazon, flipkart sales end time . Sales end time No video available in TH-cam ..

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

    using a proper state management library, It prevents this error .... never encountered,this is because a state management library like provider, bloc etc decouples the UI and is always disposed properly

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

      I use provider and never had to handle such an issue. Seems weird having to repeat code and handle set state like that in every screen

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

    Why did you stop making videos?

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

    Why it's not the default behavior?

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

    my 1 Million Dollar question is how to check for if mounted when using stateless widget with any state management like GetX or provider

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

    Very ba you left making video just for some money you are getting think about future generations students very bad .
    Kindly spare some time : future students will came to know easily this tech stack
    Why I'm saying to you is you are good enough in this