Flutter Hooks — The complete crash course
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:
I think we can all agree, that the right code is way cleaner, even if it has the exact same…