finds.dev← search

// the find

rrousselGit/flutter_hooks

★ 3,330 · Dart · MIT · updated May 2026

React hooks for Flutter. Hooks are a new kind of object that manages a Widget life-cycles. They are used to increase code sharing between widgets and as a complete replacement for StatefulWidget.

flutter_hooks ports React's hook pattern to Flutter, letting you replace StatefulWidget boilerplate with composable `use*` functions called inside a `HookWidget.build`. It's from Remi Roussel, the same author as Riverpod and freezed, so it's well-maintained and widely used in the Flutter ecosystem. The target audience is Flutter developers who are tired of writing the same `initState`/`didUpdateWidget`/`dispose` triad for every AnimationController and TextEditingController.

The lifecycle management story is genuinely better than StatefulWidget — `useAnimationController()` in one line vs. 15 lines of boilerplate is not an exaggeration. The built-in hook coverage is thorough: animation, streams, futures, listenables, scroll/tab/page controllers, debounce, and app lifecycle are all handled so you rarely need to write a custom hook. Test coverage is exemplary — nearly every hook has its own dedicated test file, which matters because the index-based dispatch mechanism is easy to break subtly. Hot-reload handling is thought through: the framework detects structural hook changes and resets only the affected hooks rather than blowing up the whole widget.

The index-based ordering rule (never call hooks conditionally) is a real footgun — violate it and you get silent state corruption, not a helpful error message. There's no static analysis enforcement, unlike React where the eslint-plugin-hooks rule catches violations at write time; you have to know the rule and follow it manually. Adopting this library means your entire team needs to understand the mental model, and developers coming from non-React backgrounds will find the 'hooks are just array indices' explanation unsatisfying until it clicks. Finally, mixing hooks with Riverpod (the same author's state management library) can create confusion about which tool owns which concern — the two have overlapping surface area and the right division isn't always obvious.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →