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

Flutter Tutorial for Beginners #24 - Widget Lifecycle

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ส.ค. 2024
  • ----------------------------------------
    🐱‍💻 🐱‍💻 Course Links:
    Course files - github.com/iam...
    Android Studio - developer.andr...
    Git - git-scm.com/do...
    Flutter Installation - flutter.dev/do...
    🐱‍💻 🐱‍💻 Other Related Courses:
    + Modern JavaScript Tutorial - www.udemy.com/...

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

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

    Since Flutter 2.5.0 on, a new button set has been replaced for RaisedButton with ElevatedButton, FlatButton with TextButton and OutlineButton with OutlinedButton.

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

      Why would they do this to us? :D

  • @HARSHITKUMAR-wj4ex
    @HARSHITKUMAR-wj4ex 4 ปีที่แล้ว +55

    I haven't commented yet, but now i have to say man your tutorials are addictive.Literally I could not stop watching your series.
    Great work!!!!

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

      Thanks so much! Glad you like them! :)

  • @beratdinckan5585
    @beratdinckan5585 3 ปีที่แล้ว +10

    Perfect series. The only reason why I get premium TH-cam for downloading your Playlist :) thanks for the flutter series. I hope you keep adding new flutter tutorials. Thanks again Best regards.

  • @seaque.
    @seaque. 2 ปีที่แล้ว +9

    for new Flutter version you need ElevatedButton, and it needs a style.
    add this as a local variable, preferably above counter.
    final ButtonStyle raisedButtonStyle = ElevatedButton.styleFrom(
    onPrimary: Colors.black87,
    primary: Colors.grey[300],
    minimumSize: Size(88, 36),
    padding: EdgeInsets.symmetric(horizontal: 16),
    shape: const RoundedRectangleBorder(
    borderRadius: BorderRadius.all(Radius.circular(2)),
    ),
    );
    then use ElevatedButton like
    body: ElevatedButton(
    style: raisedButtonStyle,
    onPressed: () {
    setState(() {
    counter += 1;
    });;
    },
    child: Text('counter is $counter'),
    ), //ElevatedButton
    ); //Scaffold

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

    I just want to thank you netninja! We're doing a mobile app using flutter, and we don't know anything about mobile developing. You are a life saver! Thank you for the free course! 11/10!

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

    From Pakistan
    I love the way you explains things, crystal clear 🖤🖤💙💙 stay blessed

  • @tekki.dev.
    @tekki.dev. 4 ปีที่แล้ว +5

    amazing videos bruh....
    TH-cam needs to suggest this to anyone who searches for flutter

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

    Best Flutter tutorial series I have ever seen, thanks for sharing.

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

    I just wanted to say a huge thank you. I am not really in a position to subscribe to your patreon but I just want to say I really appreciate these tutorials and they have made my week in lockdown very enjoyable!

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

    Quick FYI -- 1:55 - you said that Build() is called a lot in a Stateless widget, when I think you meant Stateful.

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

    Love from Algeria !
    Text( ' Awesome work ! ' )

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

      Please do not put spaces before punctuation marks :-)

    • @hamza-325
      @hamza-325 3 ปีที่แล้ว

      Love += 1; // from Algeria

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

      @@psyhonut why not !

  • @2chotti
    @2chotti 10 หลายเดือนก่อน +1

    I am addicted to this series. Thanks for making flutter interesting buddy.

    • @NetNinja
      @NetNinja  10 หลายเดือนก่อน

      Glad to hear it! :) thanks for watching

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

    After 23 videos, I've started to just press the like button at the beginning of the video

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

      Thanks so much :)

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

      Why? The series was good from the very beginning.

  • @andreranulfo-dev8607
    @andreranulfo-dev8607 4 ปีที่แล้ว +10

    "The Routs is a pathway to many possibilities, some consider to be..unnatural”;

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

    love from INDIA ♥♥♥
    show the support from India guys 🎇🎈🎇

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

    Great series , Really helped me to get started with Flutter

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

    Thanks for the tutorials. You do a great job man! Thank you!

  • @Tboxred
    @Tboxred 4 หลายเดือนก่อน +1

    God bless you man, great teacher💯

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

      I appreciate that! :) thanks

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

    that video was a good one man. hugely appreciate the explanation. Love the way you teach

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

      Glad it was helpful! :) thanks for watchng

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

    Everything explained very well. Thank you Sir.

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

    Loving this series.

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

      Great to hear!

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

    Awesome work.....i like all your videos(i am 12 and i am learning flutter and some other programming langs) and you are an awesome teacher!!!!!!

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

      Awesome! Thanks so much, and I think it's awesome you are just 12 and learning all this :D

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

      @@NetNinja Thanks

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

    I dont know how to express my feelings...But your teaching style is awesome++++++++++++++++++++++++++++++..Thankyou!!so much!!

  • @francisco.mendes
    @francisco.mendes ปีที่แล้ว

    i wonder if we just create every page as a stateless widget and only its inner widgets that we want to change as stateful would improve performance a lot... because like in tbhe video, we are reloading the whole page and we just want one button to change over time so making only the button stateful wouldn't it be better? thank u in advance and for this amazing series. ive been loving it so far!

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

    No one:
    Shaun: Boasts how TODO is a great feature in Android Studio only to not use it.

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

    Thanks you , you are awesome ,struggling for these concepts now all clear !!!

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

    I understand that initstate function will implement data once, but I still don't understand why we should use the intitstate, it's not clear to me till now, Shaun, can you help me with that?

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

    So we should write our own code below the super... in the initState() method? Then why is the //TODO comment automatically added above it?

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

    one of the best explanations. thanks a lot

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

    Dispose would be
    @override
    void dispose() {
    // TODO: implement dispose
    super.dispose();
    print('dispose');
    }

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

    Hehe this is much easier when you know react beforehand :p
    InitState = componentDidMount
    Build = componentDidUpdate
    Dispose = ComponentDidUnmount
    I wish someday Google include Hooks to Flutter too :p

  • @user-px1mc1tb1b
    @user-px1mc1tb1b 11 หลายเดือนก่อน

    Really great videos I must say, thank you! I just wonder what the initState function is for? I out commented that one and everything was doing what it was supposed to. So why do I need the initState function?

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

    Thumbs up, clean explanation, thank you!

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

    Same concept as react Dom updating. Thanks sir.

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

    how can i catch that a route/widget is being shown again on screen , when i do Navigator.pop()
    when popping it shows the anterior route, but doesn't trigger build or initState ,
    it simply showing an old built widget , which has lost its data because of memory management ( which i would recover on a build() or initState, if it was called )

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

    hello Shawn, can you tell me based on your youtube statistics, how many people from Jamaica watched this playlist???

  • @misterbigstuff8503
    @misterbigstuff8503 5 หลายเดือนก่อน

    Nice videos, i really enjoyed all f them, please is there an IDE for flutter development?

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

    fantastic! great lesson!

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

      Thanks! 😃

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

    your work is Awesome. I really enjoy every video...

  • @user-nd5kf1gh9t
    @user-nd5kf1gh9t 4 ปีที่แล้ว +1

    I like this video.

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

    I am not that good at object-oriented programming but, I know basic stuff. I had to rewatch the quotes applications' tutorial again and again and I kinda understand it now. Still not clear but, hope someday I'll be good at it. Should I worry about not being able to understand that?. Also thanks for these awesome videos.

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

      Hey. Same here. Watching the videos and sometimes I worry about not understanding the quotes application better. Should I really need to worry? Or should I just continue. Now that I think you have watched all the videos and working on a app on your own.

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

    Best Tut. Ever , working with it

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

    this man is amazing ever

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

    Love from china! too good to be free.

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

    What are the differences/implications of putting the counter increment *before* the setState() call rather than inside it? They both work the same, afaik.

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

    Great series

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

    Great video my friend. Thank you👍

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

    best sensei in the world

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

    Keep it up! I have already learned so much :D

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

    god bless you man

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

    Man - you are fantastic!

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

    very good content.... me likey

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

    amazing tutorial

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

    Very nice tutorial s

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

    I didn't get it: how did the button change if we hadn't given it a key arg? Without a key argument our widget should be updated, but not rewritten on the screen, isn't it so?

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

    Sir plz make a tutorial on firebase with flutter

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

      Working on it :)

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

    Thanks a lot :)

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

    hello !!
    excuse me the variable counter shows as an undefined name could you help me !!!!!

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

    Theory in between practicals 😳

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

    When I type “init”, I don’t have the suggestion how come?

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

    Can we make stateful widget inside stateless widget?

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

    Followed steps exactly but at 6:39, got this error for counter - Undefined name 'counter'

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

    I need to plant a farm of likes for your course Sir.

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

    I am trying to add the counter function, but it keeps giving me an error of " undefined name".

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

    why didn't you include the rest of the lifecycle methods? like didChangeDependencies etc.

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

    youaregreat!

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

    Sir, please tell me the extension of vs code for flutter

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

      'flutter' and also 'dart'

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

    Amazing n_n !!!!!!!!!!

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

    2:30

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

    Anyone knows ? do they teach flutter in Uni's ? great videos btw !

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

      No, I don't think they do, they only teach android development with Java and kotlin

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

      @@hvtarun7030 Nope. Uclan Uk started to teach Flutter. My professor said hopefully from next year in my Uni too.

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

      @@hvtarun7030 I mean, It's not that I don't like Android - but it's pointless learning just 50% of the market

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

      @@wearecode9199 True....I agree with you 1000%, but most colleges are still teaching java and kotlin because either they are not aware of the existence of flutter or don't have staff qualified enough to teach it, which is why I really think people like the net ninja are doing an excellent job teaching on a platform like youtube and making their content available to a wide audience.

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

      @@hvtarun7030 Yup that's right, but if you think about it if it takes longs to introduce something new into an educational system, then that new will become old, so we will always learn what's old and not quite suitable to the market :) a bit of a paradox there lol

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

    Hopefully someone can help answer.
    I have followed along just fine and everything works, but my print statement when clicking the button only prints every so often.
    The counter updates and the button text is updated every single time, but the "build function ran" print statement only prints maybe every 3-5 seconds. If I double click or triple click the button, the numbers increase properly, but the print statement doesn't run.
    Is there a reason for this?
    I clicked 11 times and only got 3-4 print statements out of it.
    Not a big deal as all the real functionality seems to be fine, just curious.

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

      most likely memory utilisation management or something , because why run the function 10 times , when you can run it 3 or 4 times and get the same result , a neat feature I might add

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

    Your tutorials are very very good. But you talk too much. Even saying same thing again and again.
    I think you should focus on talking less. Just describe once, run app, show what happens, that's it. You don't need to describe again after run.
    Thanks for your efforts.

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

      He's always super clear.
      Being slightly redundant, sometimes, is a good thing.

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

      Well, not everyone can understand from hearing once xD