Learn Flutter Hooks and Maximize Your Code Reuse

  Рет қаралды 62,064

Robert Brunhage

Robert Brunhage

Күн бұрын

Пікірлер: 95
@martinalcala4823
@martinalcala4823 3 жыл бұрын
As a React developer, this was sooo beautiful!
@DoctorCode9
@DoctorCode9 4 жыл бұрын
I never heard about Flutter Hooks before this video, Thanks man ❤
@balajijangde8470
@balajijangde8470 4 жыл бұрын
me too
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
Glad I could be of help!
@catalinstroe22
@catalinstroe22 4 жыл бұрын
Came here after i just learned about react hooks :)
@youtornado
@youtornado 4 жыл бұрын
My first action: Installing the Remove Comments Extension 😂
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
That is all I wanted!
@keithbacalso9433
@keithbacalso9433 4 жыл бұрын
Wait so it is an extension?!😱
@DavidSmith-ef4eh
@DavidSmith-ef4eh 4 жыл бұрын
Great stuff, almost exactly like in React. The only problem I have with it, I rarely share code between widgets. But I'll keep that library in mind for future scenarios.
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
Thank you I really like it as it has predefined hooks for things like state, animation etc which makes it a lot easier to implement in general!
@whyimustusemyrealname3801
@whyimustusemyrealname3801 3 жыл бұрын
yeah same here even though I appreciate it that remi push this into main repo, until this moment I never think that I need hook in flutter, in react though I really loves hook and always use hook whenever I can
@marcoscarlomagno3065
@marcoscarlomagno3065 2 жыл бұрын
So nice content :) I think one important principle is that everything in flutter is a widget, so in this case I would create a widget for the timer and reutilize/customize it across the app instead of reutilizing the functionality. But anyway is so great to count with that library for some special scenario
@wongvoonngee3307
@wongvoonngee3307 4 жыл бұрын
Heard the Hook before, but never know how use it until now. 😀 Great tutorial, and keep it up 😍
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
Happy to help!
@lakratihamza
@lakratihamza 3 жыл бұрын
Amazing 👏 Love that so much, very similar to react hooks which I am a very huge fan of 😍😍
@morchedlafferty8614
@morchedlafferty8614 3 жыл бұрын
Good presentation. Keep this up! - I felt like I'm watching Fireship. :)
@RobertBrunhage
@RobertBrunhage 3 жыл бұрын
Thanks, highly appreciated!
@scion911
@scion911 4 жыл бұрын
just found in KZbin recommendations ... I really liked it considering I am new to flutter in general! Thanks. Btw nice explanation not too long or too short
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
Awesome, glad you liked the content!
@adamgonzales8677
@adamgonzales8677 2 жыл бұрын
Reactjs developers are loving this feature I'm sure of it
@OICG
@OICG 4 жыл бұрын
Great Video👍! Good Explanation. Want More Videos like this !
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
More to come!
@mohammedsalman3397
@mohammedsalman3397 3 жыл бұрын
Flutter Hooks are much easier to understand and reason about and also they're just like react hooks so that's a plus
@sujalabhani980
@sujalabhani980 Жыл бұрын
Thanks for the great actual use case tutorial, but i have a question what is if i wanna know the value outside the build method? what if i wanna pass to x function without listening to? maybe i will take look at hooks package
@WonderPlayTR
@WonderPlayTR 3 жыл бұрын
I like your content.
@i.k.shaikh3772
@i.k.shaikh3772 4 жыл бұрын
Excellent Tutorial, Looking forward to an animation video
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
Have it written down!
@dev_casper
@dev_casper 2 жыл бұрын
Great explanation.
@jimmyrobert5879
@jimmyrobert5879 4 жыл бұрын
Amazing video, great job 👍🏽 Just to be sure, the context parameter in your useInfiniteTimer function is useless here, am I wrong?
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
Oh yeah, that is a miss. The context is not needed! I commited a change on GitHub
@JohnDoe-fv5cu
@JohnDoe-fv5cu 4 жыл бұрын
The same stuff can be implemented using mixins, without any third party libraries
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
Yes but there are other drawbacks with that: github.com/flutter/flutter/issues/51752
@EduardoLima-pi7fl
@EduardoLima-pi7fl 4 жыл бұрын
Hi John, I'm starting with Flutter and I was curious how this can be implement using mixins, could you share an example? Tnks
@abmarees
@abmarees 4 жыл бұрын
(8:11) useInfiniteTimer method is having a parameter BuildContext, but is it necessary ? Because it is not used by the method 🤔
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
It was a mistake and fixed if you check the GitHub repo in the description!
@rikiyanuar547
@rikiyanuar547 3 жыл бұрын
great tutorial 👍
@hadirahmani7943
@hadirahmani7943 2 жыл бұрын
thanks, so what was the result?
@rishabh0.8
@rishabh0.8 3 жыл бұрын
explained very well.
@rcjuancarlosuwu
@rcjuancarlosuwu 3 жыл бұрын
Good job! It was really clear to understand. thanks!
@adrisongomez6482
@adrisongomez6482 4 жыл бұрын
Sound Great. I love it.
@veeresh4441
@veeresh4441 4 жыл бұрын
Can't we use state management (like redux bloc or provider) for this purpose.
@grAPPfruitMacroCraft
@grAPPfruitMacroCraft 4 жыл бұрын
Is it not possible to do the same thing with mixins?
@abe10
@abe10 4 жыл бұрын
It's so similar to react hooks :)
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
It's a Flutter implementation of it!
@anggapande8395
@anggapande8395 4 жыл бұрын
hay, can you give a tutorial to create customize cluster in map. i already try with plugin but it not bocome what i want and the clustering is not smooth.
@farhadentezari6206
@farhadentezari6206 4 жыл бұрын
Very well explained thanks! I dont get dispose() - what happens if you forget to dispose?
@unknownunicorn1373
@unknownunicorn1373 2 жыл бұрын
You'll end up w/ a memory leak and/or unnecessary cpu usage if you create a lot of timers and leave them running in the background
@marflage
@marflage 3 жыл бұрын
I am new to state management. Could anybody explain the difference between hooks, getx, provider, and riverpod? Or are they used for the same thing but with different implementations? Thanks!
@TekExplorer
@TekExplorer 2 жыл бұрын
hooks isn't really a state management solution - its a way to separate reusable _logic_ from your widgets the others _are_ state management libraries, however, note that getx is a highly controversial package as it does things in a way many people dislike, plus i think there was some drama about it at some point. riverpod is said to be a rewrite of provider.
@marflage
@marflage 2 жыл бұрын
@@TekExplorer thanks for the reply. But isn't state management accomplished through separation of concerns? Yeah, I have heard about the whole drama about getx's author claiming his package was the best.
@TekExplorer
@TekExplorer 2 жыл бұрын
@@marflage I don't think that's technically necessary for a state management solution to be a state manager. Regular ol statefulwidget is a state management solution, after all (though not a good one for anything outside the widget on its own)
@marflage
@marflage 2 жыл бұрын
@@TekExplorer I see, thanks
@soumikpaul7960
@soumikpaul7960 4 жыл бұрын
Great learning content! Btw which ide is that?
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
I am using VSCode!
@soumikpaul7960
@soumikpaul7960 4 жыл бұрын
@@RobertBrunhageHow did you get that background color in vscode? It looks so stunning and beautiful!
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
@@soumikpaul7960 hmm maybe it's my theme, I don't really know haha. I am using One Dark Pro. Give it a go and see if it's what you are after!
@soumikpaul7960
@soumikpaul7960 4 жыл бұрын
@@RobertBrunhage Thanks a lot loved your content!
@f-person
@f-person 4 жыл бұрын
Why did you need context argument for useInfiniteTimer?
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
Nope I have updated the code in GitHub! See the link in the description, was a mistake and didn't notice it haha
@f-person
@f-person 4 жыл бұрын
Okay. Thanks for the video!
@thkp-eng
@thkp-eng 4 жыл бұрын
Very cool! Always wondered if hooks could be applied to Flutter given it's conceptual similarity to React!
@Balqini
@Balqini 3 жыл бұрын
What is the extension that you use in the 1:31 ? I'm new to flutter.
@jousis_
@jousis_ 3 жыл бұрын
Pubspec assist
@SirJagerYT
@SirJagerYT 2 жыл бұрын
i dont understand why we need to pass context inside useInfiniteTimer(context); Why ?
@shlokbhakta2893
@shlokbhakta2893 2 жыл бұрын
Man woke up and chose violence with the comments
@SuperHesni
@SuperHesni 4 жыл бұрын
Can you please make a video on how to use moor in flutter web , thank u for all the good videos
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
Great suggestion!
@mohammadtalha2336
@mohammadtalha2336 4 жыл бұрын
Just write stl instead of stle and stf for statefullwidget
@syleishere
@syleishere 3 жыл бұрын
He seriously needs to learn getX. He doesn't even need to use stateful widgets anymore, this is so old school
@nt4f04und
@nt4f04und 4 жыл бұрын
horrible anti-pattern for flutter as per me and the flutter team itself, if you follow up the github.com/flutter/flutter/issues/25280 what the heck do hooks give you you can’t achieve with flutter state management toolings. remember the hooks will definitely have some performance drawback
@maconbacon
@maconbacon 4 жыл бұрын
Same thing I was wondering, so many drawbacks, no clear advantage that could only be accomplished by the use of hooks or at least largely advantegeous
@hawkybae
@hawkybae 4 жыл бұрын
Definitely a good idea not choosing to add hooks to the core Flutter framework. Also making a core architectural change because it 'works' on another framework is absurd. Nevertheless, it's good having the option to use hooks as a separate package.
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
I would not say it's a anti-pattern and nothing that the Flutter team has said either (to my knowledge). I recommend this post github.com/flutter/flutter/issues/51752 for more indepth information.
@nt4f04und
@nt4f04und 4 жыл бұрын
what i think about this whole thing github.com/flutter/flutter/issues/51752#issuecomment-723564582
@jasonsebring3983
@jasonsebring3983 3 жыл бұрын
way cleaner, smaller code, good stuff. ... now how to do this with global state, streams etc...
@tarunverma8693
@tarunverma8693 4 жыл бұрын
Can you help me for How to start freelancing as a flutter developer...
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
I would if I was someone that had been doing freelancing, sadly I have not :(
@tarunverma8693
@tarunverma8693 4 жыл бұрын
@@RobertBrunhagebut how flutter developer make passive income.
@youtornado
@youtornado 4 жыл бұрын
Freelancing is not about passive income - it is more about improving your Flutter skills, applying for projects, and doing actual work...
@rumble1925
@rumble1925 3 жыл бұрын
@@tarunverma8693 you get passive income from having people work for you or make a product to sell. Freelancing means selling your own time, which is not passive.
@beijunxi4697
@beijunxi4697 4 жыл бұрын
aaaaaaamazing
@ankitrathore3946
@ankitrathore3946 4 жыл бұрын
Why are you making flutter looks like react ??
@waiyanphyo7
@waiyanphyo7 4 жыл бұрын
totally agree no longer flutter style -_-
@Algardraug
@Algardraug 3 жыл бұрын
Not a fan of useEffects. So much extra messy code with anonymous functions within another function. Less readable than separating code into different functions
@blackhatvisions
@blackhatvisions 4 жыл бұрын
Repeating the regular code 7 times is easier than implementing the hook.
@ShawnBlais
@ShawnBlais 4 жыл бұрын
Unless you had a bug... then you just copied it 7 times across your app. Or if something has to change, you now have 7 maintenance points.
@SAMSHELDINTHOMAS
@SAMSHELDINTHOMAS 4 жыл бұрын
Hi Can i use fluttur hook in this project,,, github.com/samsheldin/checkout hi there is a json of a shopping cart app in each object of the list there is a discount start and discount end so i know know how to make the price change based on the timing for individual products,,, but logic looks a bit confusing when i am totalling the price and displaying it in ui,,, for eg 10 + 5(discounted price) + 10 + 5(discounted price) + 5(discounted price) total price 35 now suppose after 5 min user is still on the screen discount on one of the products end it looks like this 10 + 10 + 10 + 5(discounted price) + 5(discounted price) total price 40.. So dislpaying the discount individally is alright,,, but as you can see how can i do the total price based on differnt discount start time and discount end time for each unique product this is the ui which i am implementing this ,,, so is it possible to use flutter hooks here
@hildingj
@hildingj 4 жыл бұрын
first
@RobertBrunhage
@RobertBrunhage 4 жыл бұрын
second
@elvincitore1512
@elvincitore1512 3 жыл бұрын
talk about a complete rip off of react hooks
@MisterDibitybopty
@MisterDibitybopty 3 жыл бұрын
You say that like it's a bad thing.
Learn Flutter Life Cycle In 10 Minutes
10:02
Robert Brunhage
Рет қаралды 75 М.
Flutter Hooks - Say Goodbye To Stateful Widget
10:06
Avalanche
Рет қаралды 56 М.
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 8 МЛН
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 4,9 МЛН
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 10 МЛН
Why no RONALDO?! 🤔⚽️
00:28
Celine Dept
Рет қаралды 91 МЛН
Flutter State Management Guide - What you need to know
8:57
Robert Brunhage
Рет қаралды 32 М.
State Management Like A Pro - Flutter Riverpod
10:30
Robert Brunhage
Рет қаралды 77 М.
Top 16 Dart Tips and Tricks Every Flutter Developer Should Know
11:44
Andrea Bizzotto
Рет қаралды 59 М.
KMP vs. Flutter - Who Will Win The Cross-Platform Battle?
16:19
Philipp Lackner
Рет қаралды 58 М.
Avoid using StatefullWidget!
3:50
Codrut Erdei
Рет қаралды 9 М.
Top 70 Flutter Tips, Widgets & Packages
16:22
Flutter Mapp
Рет қаралды 130 М.
Flutter State Management - The Grand Tour
14:07
Fireship
Рет қаралды 246 М.
15 Flutter Tips That MIGHT Improve Your Work
4:10
Robert Brunhage
Рет қаралды 24 М.
Chapter 6 - Flutter Hooks - Flutter State Management Course 💙
1:58:21
Vandad Nahavandipoor
Рет қаралды 14 М.
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 8 МЛН