Flutter Hooks — The complete crash course

Tomic Riedel
5 min readAug 13, 2022

Welcome to a kind of new series on my channel. It’s all about where I explain great and quite complex packages as short and easy as possible. I’ve already done this with Freezed and Isar Database, but now it’s time to convert this into a real series. So let’s get started today with Flutter Hooks!

What is Flutter Hooks?

Flutter Hooks improves the way you use StatefulWidget. it hast some mayor drawbacks when using controllers. For example, if you want to use an AnimationController, you have to create a variable, call initState, didUpdateWidget and dispose. That’s way to much code just for one controller. And now imagine doing this for multiple controllers. In addition, you have to use a mixin that be used once per class. Now, with Flutter Hooks, you just have to create a variable and call a function, where all the logic is stored. To describe it best, let’s see a comparision:

Without Flutter Hooks
With Flutter Hooks

I think we can all agree, that the right code is way cleaner, even if it has the exact same…

--

--

Tomic Riedel
Tomic Riedel

Written by Tomic Riedel

Sharing the process of building a portfolio of apps to make people more productive.