Тёмный
No video :(

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

Reso Coder
Подписаться 113 тыс.
Просмотров 35 тыс.
50% 1

Опубликовано:

 

26 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 62   
@user-zr7sg1pk3n
@user-zr7sg1pk3n 3 месяца назад
WOW NICE TUTS Man you are a good teacher. I hope you rejoin.
@agreensh
@agreensh 3 года назад
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.
@nromancarcamo
@nromancarcamo 4 года назад
This is why I felt in love with the react ecosystem, nice to see them here, on flutter :D
@BooleanDev
@BooleanDev 3 года назад
Thanks! it helped me understand hooks a lot better than the other simple examples
@chetan6406
@chetan6406 4 года назад
As always quality tutorial.....please bro make a series on flutter + firebase.
@ResoCoder
@ResoCoder 4 года назад
Working on it. You can count with it in February.
@chetan6406
@chetan6406 4 года назад
@@ResoCoder thanks bro in advance
@alexandervasilenko7773
@alexandervasilenko7773 4 года назад
@@ResoCoder Would be nice to see it!! But the question is only: based on BLoC pattern or states_rebuilder package?..?? Moreover, which DI will be used in BLoC case?
@ResoCoder
@ResoCoder 4 года назад
@@alexandervasilenko7773 Which one would you like to see?
@alexandervasilenko7773
@alexandervasilenko7773 4 года назад
@@ResoCoder Of course BLoC with get_it (for example) will produce more boilerplate code, BUT... Who knows, is it right choice to switch from well-known approaches to the modern ones? I don't know yet due to lack of experience...
@eliasavelino6729
@eliasavelino6729 4 года назад
Fantastic Job ResoCoder
@FilledStacks
@FilledStacks 4 года назад
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.
@ResoCoder
@ResoCoder 4 года назад
Thanks Daniel!
@FilledStacks
@FilledStacks 4 года назад
@@ResoCoder When your fav Flutter youtuber doesn't know your name 😭😭😭 haha, just joking. No worries. My name is Dane by the way :)
@ResoCoder
@ResoCoder 4 года назад
@@FilledStacks damn, at least I got the first three letters right 😅
@FilledStacks
@FilledStacks 4 года назад
@@ResoCoder hahaha can't deny that :)
@rahulbaghel-dev
@rahulbaghel-dev 3 года назад
Mind blowing learning
@MahbuburRahman-uc7np
@MahbuburRahman-uc7np 3 года назад
Thanks for the amazing tutorial Reso. Great Work.
@pancakez7022
@pancakez7022 4 года назад
Very useful tutorial , I cross GFW to watch your video ,keep it up~!
@ResoCoder
@ResoCoder 4 года назад
Thanks for watching!
@tsuganekazuhiko3607
@tsuganekazuhiko3607 4 года назад
Thank you for this detailed tutorial on hooks!
@sayedzainamroti
@sayedzainamroti 3 года назад
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 :)
@verryondrums
@verryondrums 4 года назад
Very helpful! Best quality as usual... Keep it up!
@chordfunc3072
@chordfunc3072 4 года назад
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
@ResoCoder
@ResoCoder 4 года назад
I also follow this rule but only in areas where I'm not sure of further implementation. It's not a bad thing to add multiple layers from the beginning if you know you'll need them.
@chordfunc3072
@chordfunc3072 4 года назад
​@@ResoCoder Exactly, creating a level of indirection when accessing a datastore of some sort, for example, is probably a good idea, but creating a generic class to deal with some domain-specific issue that I haven't wrapped my brain around yet is probably a baaaad idea.. Keep the content coming :D I always learn a lot from your videos :D
@jefffrazier6813
@jefffrazier6813 4 года назад
Excellent explanation!
@RetroPortalStudio
@RetroPortalStudio 4 года назад
Really a great tutorial ✌️😎 Helpful !
@christianonwe2045
@christianonwe2045 4 года назад
This is awesome thanks
@WendellSilvaQuaternionsRocks
@WendellSilvaQuaternionsRocks 4 года назад
Really useful tutorial. Thanks a lot!
@fgblomqvist
@fgblomqvist 4 года назад
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).
@hardngoclife
@hardngoclife 4 года назад
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!
@ValdaXD
@ValdaXD 4 года назад
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? 🤔🤔
@JohnWehrle
@JohnWehrle 4 года назад
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.
@ResoCoder
@ResoCoder 4 года назад
You have to use the HookWidget. As soon as you have one hook, everything has to be migrated to hooks. Keeping state is easy with the useState hook which grants you a ValueNotifier.
@fgblomqvist
@fgblomqvist 4 года назад
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?
4 года назад
Record more videos about MobX
@alhasanaboobaid
@alhasanaboobaid 4 года назад
Very usefull video. Thank you
@pedrosanchezroca181
@pedrosanchezroca181 4 года назад
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.
@double8tz
@double8tz 4 года назад
As it was stated at 12:18 ,the disposal of animation controller will be handled by the hook itself, you will be only required to dispose the custom controller eg scrollcontroller i
@aboalwajeeh9471
@aboalwajeeh9471 4 года назад
You are the best
@hamidjahandideh8142
@hamidjahandideh8142 4 года назад
thanks reso
@bascelik91
@bascelik91 4 года назад
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.
@sergey_molchanovsky
@sergey_molchanovsky 4 года назад
EventBus is basically a wrapper around StreamController.
@dennisbarzanoff9025
@dennisbarzanoff9025 3 года назад
I wish they were a part of flutter because stateful widgets suck af
@gaetans.4291
@gaetans.4291 4 года назад
Very good video ! What font are you using in VSCode ?
@inwm07gmailcom
@inwm07gmailcom 4 года назад
I'm interested too
@ZeinErsyad
@ZeinErsyad 4 года назад
thank u :)
@rahulbaghel-dev
@rahulbaghel-dev 3 года назад
I am your fam
@this.is.lapc506
@this.is.lapc506 3 года назад
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.....
@asadsalehumar1011
@asadsalehumar1011 3 года назад
IMHO, the purpose of Hooks was not to avoid classes. Sure you do have it in React. But the real purpose is to make a logic sharable. This is the point. In React (before hooks), it was easy to share components, but to share logic was really hard. You need to do HOC or Render Props. With hooks, those logic can be encapsulated into a function and be called from any of your components. Just like the hook animation here.
@cruelplatypus67
@cruelplatypus67 4 года назад
This looks like similar to react hooks methodology.
@ResoCoder
@ResoCoder 4 года назад
That's exactly what Rémi, the author of this lib, was inspired by.
@ShivamJha00
@ShivamJha00 4 года назад
It is basically a reimplementation of react hooks in flutter
@spiralni
@spiralni 3 года назад
I will use hooks to death!
@JoeHacobian
@JoeHacobian 4 года назад
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.
@ResoCoder
@ResoCoder 4 года назад
I think that Dart will, sadly, never be functional enough. What do you see with hooks that convinces you about them being a paradigm change? From what I discovered, they're just smaller and reusable StatefulWidgets. EDIT: I probably know - composability by calling hooks within hooks.
@asadsalehumar1011
@asadsalehumar1011 3 года назад
What do you think about this github.com/flutter/flutter/issues/51752 ?
Далее
Freezed ❄ - Data Class & Union in One Dart Package
36:28
Flutter Hooks - Say Goodbye To Stateful Widget
10:06
Просмотров 56 тыс.
Flutter Bloc & Cubit Tutorial
47:58
Просмотров 121 тыс.
Top 12 Flutter Tips & Tricks
9:32
Просмотров 267 тыс.
Complex Animations in Flutter using Rive | Flare
15:44
Просмотров 224 тыс.
Flutter Freezed | Code Generation
7:29
Просмотров 4 тыс.
Riverpod 2.0 - Complete Guide (Flutter Tutorial)
1:03:37
Просмотров 109 тыс.
Environments (Flavors) in Flutter with Codemagic CI/CD
1:02:30