Flutter Hooks Tutorial – Hide FAB Animation – 100% Widget Code Reuse

Flutter Hooks Tutorial – Hide FAB Animation – 100% Widget Code Reuse

Reso Coder

4 года назад

34,718 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Rahul Aadi
Rahul Aadi - 20.08.2021 19:43

Mind blowing learning

Ответить
Rahul Aadi
Rahul Aadi - 20.08.2021 19:43

I am your fam

Ответить
Mahbubur Rahman
Mahbubur Rahman - 09.07.2021 20:01

Thanks for the amazing tutorial Reso. Great Work.

Ответить
Boolean
Boolean - 30.04.2021 17:38

Thanks! it helped me understand hooks a lot better than the other simple examples

Ответить
Zayn
Zayn - 07.03.2021 22:50

Great tutorial, really helpful. and i think we can dispose controllers inside our custom functional hooks as well using useEffect hooks' return method. no need to create hooks with classes :)

Ответить
Dennis Barzanoff
Dennis Barzanoff - 20.01.2021 01:06

I wish they were a part of flutter because stateful widgets suck af

Ответить
Andy Greenshaw
Andy Greenshaw - 11.01.2021 15:09

I just found this tutorial, thanks for making it. I would recommend keeping the 'super' calls (in init and dispose) as they are present in the super class (even if they are empty at the moment). In future versions, they may add some extra code here, which you will lose by not calling them, potentially breaking your app.

Ответить
spiralni
spiralni - 02.10.2020 01:24

I will use hooks to death!

Ответить
Andrés Peña Castillo
Andrés Peña Castillo - 20.09.2020 03:07

I understand the idea of using hooks in Flutter this way... however I feel I still don't really grasp the benefit of it:

in React Native, when you use the Hooks API, you don't really need a Hook class, it really is a function, seems to me like a lambda expression or an anonymous expression is being used.

If you need a Hook class, and extending the original Home stateful widget into a HookWidget... is it really a Hook?

I thought the idea behind Hooks was to avoid classes, but here we need to put those functions inside a class... Mmmmhhh.....

Ответить
ValdaXD
ValdaXD - 04.09.2020 05:59

Thats awesome. I have a small question

I use multiple inheritedWidget for having one stateful core. And everything else is a const stateless widget.

If i convert some of my stateles widget to hookswidget... will the 'hooks' that i use be the same when the widget rebuilds? Or it does ignore lifecycles and use the same hook? 🤔🤔

Ответить
ncardez
ncardez - 05.08.2020 05:26

This is why I felt in love with the react ecosystem, nice to see them here, on flutter :D

Ответить
Sergey Molchanovsky
Sergey Molchanovsky - 26.07.2020 21:01

Thank you, the only Flutter Hooks tutorial I managed to found in a whole Internet.
Need explanation about useState() and useEffect() hooks as well.
I think that in this particular case you could use a ready-made useScrollController() hook inside of your useScrollControllerForAnimation() method to not to turn it into class. But for learning purposes it's alright.

Ответить
Ngoclife
Ngoclife - 17.06.2020 11:09

I just watched this video on Flutter Hooks and I have been watching your other tutorials with Blocs.
I'm thinking that Hooks can actually be used quite seamlessly with our BLoC logic as well too right? Let's say that certain apps need to do some actions for a "BLoC" hook if that BLoC hook is attached to the widget. What do you think? I would really like to hear your ideas on this!

Ответить
fgblomqvist
fgblomqvist - 07.05.2020 17:08

I'd love to hear your (Reso Coder's) opinion on this vs. Blocs, since you generally promoted those in all your 2019 videos. To me, Hooks seem better/easier to use (yes, I come from the React world).

Ответить
Tsugane Kazuhiko
Tsugane Kazuhiko - 05.05.2020 05:04

Thank you for this detailed tutorial on hooks!

Ответить
fgblomqvist
fgblomqvist - 21.04.2020 20:18

How would you avoid the custom Scrollcontroller hook while still using the animation hook? Since you now inherit from HookWidget, there will be no dispose etc. (like you mentioned) so how is it possible to not abstract the Scrollcontroller away?

Ответить
Jeff Frazier
Jeff Frazier - 05.02.2020 19:50

Excellent explanation!

Ответить
Mr.Peter.R.
Mr.Peter.R. - 31.01.2020 12:08

Good tutorial, just as a side note, as the code is now, you have a memory leak if you do not dispose the controller for the animation. You seem to be disposing only the scrollcontroller inside the hook.

Ответить
Kelven Galvão
Kelven Galvão - 27.01.2020 04:12

Record more videos about MobX <3

Ответить
Lazar Jovicic
Lazar Jovicic - 25.01.2020 15:37

Create video about EvnetBus library. I had a problem few weeks ago with hiding bottom nav bar and app bar when user scrolls. I solve it with EventBus lib.

Ответить
Hamid Jahandideh
Hamid Jahandideh - 25.01.2020 12:18

thanks reso <3

Ответить
Pancake Z
Pancake Z - 25.01.2020 08:32

Very useful tutorial , I cross GFW to watch your video ,keep it up~!

Ответить
RetroPortal Studio
RetroPortal Studio - 24.01.2020 18:53

Really a great tutorial ✌️😎 Helpful !

Ответить
Gaëtan S.
Gaëtan S. - 24.01.2020 18:22

Very good video ! What font are you using in VSCode ?

Ответить
Christian Onwe
Christian Onwe - 23.01.2020 01:33

This is awesome thanks

Ответить
Joe Hacobian
Joe Hacobian - 22.01.2020 10:02

Just not a fan of react. I prefer Flutter’s (and by extension Dart’s) take on composition. What this really does is attempt to make an OOP framework functional. The term ‘hook’ is just a Trojan horse for a paradigm takeover.

Ответить
FilledStacks
FilledStacks - 22.01.2020 09:15

Yeah Yeah! Code reuse it the way to go :) Great video on creating a custom hook. Definitely will be using this in my tutorials / projects as well where I can. Thanks for the detailed video. Very helpful.

Ответить
ChordFunc
ChordFunc - 22.01.2020 08:49

That so cool! Hooks look awesome.

I also 100% agree with you, that if you only use it in one class, It's not a good idea to CREATE a hook just to use the hook in one widget, if one is already provided for you then that's awesome :D I'll probably start using this library just to take advantage of the useAnimationController hook!

I have a personal rule that I never create an abstraction before It becomes necessary. I always start with something that is as concrete as possible that's only used in one place with as little indirection as possible, and if the need arises I create an abstraction that are more versatile :D

Ответить
Abo Alwajeeh
Abo Alwajeeh - 22.01.2020 08:27

You are the best

Ответить
verry on drums
verry on drums - 22.01.2020 05:07

Very helpful! Best quality as usual... Keep it up!

Ответить
Zein Ersyad
Zein Ersyad - 22.01.2020 03:56

thank u :)

Ответить
Cruelplatypus67
Cruelplatypus67 - 22.01.2020 02:30

This looks like similar to react hooks methodology.

Ответить
Wendell Silva
Wendell Silva - 22.01.2020 01:58

Really useful tutorial. Thanks a lot!

Ответить
John Wehrle
John Wehrle - 22.01.2020 01:15

If we have a more interactive screen where variables are being set (StatefulWidget) with the hook being called from the build function as it is here it is going to be remade each time we setState(), right? But in this case could we call the hook in initState and use it as a container for our controllers? I can definitely see the benefit of containing the controllers this way because that code can overwhelm everything else.

Ответить
Alhasan Abo Obaid
Alhasan Abo Obaid - 21.01.2020 23:00

Very usefull video. Thank you

Ответить
Elias Avelino
Elias Avelino - 21.01.2020 22:51

Fantastic Job ResoCoder

Ответить
CHETAN
CHETAN - 21.01.2020 22:32

As always quality tutorial.....please bro make a series on flutter + firebase.

Ответить