leancode_hooks
0.1.2+1, released 9 months ago by leancode.co
A collection of utility hooks for Flutter, including BLoC integration and controllers.
What it does
Provides a collection of frequently used hooks gathered in one place, including hooks for BLoC state management, text editing controllers, debounce, throttle, and disposables. It also exports package:flutter_hooks for convenience.
AI-written summary of version 0.1.2+1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are using flutter_hooks and want ready-made hooks for BLoC integration.
- You need convenient utility hooks like useDebounce, useThrottle, or useDisposable.
- You want consistent versioning and better discoverability for common hooks.
Skip it when
- You do not use flutter_hooks in your project.
- You prefer traditional stateful widgets over hooks.
Strengths
- Bundles useful BLoC hooks like useBloc, useBlocListener, and useBlocState.
- Exports package:flutter_hooks so you don't need to add it separately.
- Production-ready and maintained by LeanCode.
Weaknesses
- Adds a dependency on flutter_hooks and bloc.
- Limited to the specific set of hooks provided by the package.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Add leancode_hooks to your pubspec.yaml dependencies.
import 'package:leancode_hooks/leancode_hooks.dart';Alternatives
Packages that do the same job and could replace leancode_hooks.
- flutter_bloc
If you prefer official BLoC widgets like BlocBuilder and BlocListener instead of hook-based equivalents.
86Compare
Works with
Packages commonly used together with leancode_hooks: ones it builds on, ones built on it, and its own family.
- blocleancode_hooks depends on itA Dart library for implementing the BLoC pattern with Cubits and Blocs.
- flutter_hooksleancode_hooks depends on itA Flutter implementation of React hooks for managing widget life-cycle and code reuse.
- leancode_lintSame familyAn opinionated set of high-quality, robust, and up-to-date lint rules used at LeanCode.
- leancode_cubit_utilsBuilt on leancode_hooksCubits and widgets to eliminate boilerplate for single requests and paginated pages.