flutter_hooks 0.21.3+1
flutter_hooks: ^0.21.3+1 copied to clipboard
A flutter implementation of React hooks. It adds a new kind of widget with enhanced code reuse.
0.21.3+1 - 2025-08-19 #
Updated Discord link
0.21.3 - 2025-08-12 #
- Deprecated
useExpansionTileControllerin favor ofuseExpansibleController. - Added
useCupertinoTabControllerthanks to @Erengun - Added
useSnapshotControllerthanks to @benthillerkus - Added
descendantsAreTraversabletouseFocusNodethanks to @gabber235
0.21.2 - 2025-02-23 #
- Add
useCarouselController(thanks to @riscait) - Add
useTreeSliverController(thanks to @benthillerkus) - Added
useOverlayPortalController(thanks to @offich) - Add animationDuration property to useTabController hook (thanks to @d-polikhranidi)
0.21.1-pre.4 - 2024-08-01 #
- Added
useFixedExtentScrollController(thanks to @whynotmake-it)
0.21.1-pre.3 - 2024-07-30 #
- Added
useOnListenableChange(thanks to @whynotmake-it)
0.21.1-pre.2 - 2024-07-22 #
- Added
onAttachandonDetachtouseScrollControllerandusePageController(thanks to @whynotmake-it)
0.21.1-pre.1 - 2024-07-08 #
- Added
useDraggableScrollableController(thanks to @dickermoshe) - Fix TickerMode not getting muted by hooks (thanks to @dev-tatsuya)
0.21.1-pre.0 #
- Bump minimum Flutter SDK to 3.21.0-13.0.pre.4
0.21.0 - 2024-03-22 (retracted) #
- Renamed
useMaterialStatesControllertouseWidgetStatesControllerto follow the rename in Flutter.
0.20.5 - 2024-02-05 #
- Deprecate the
useIsMountedhook as you should useBuildContext.mountedinstead if you're on Flutter 3.7.0 or greater
0.20.4 - 2023-12-29 #
- Added
useDebounced(thanks to @itisnajim) - Removed
@visibleForTestingonHookMixin
0.20.3 - 2023-10-10 #
- Added
useExpansionTileController(thanks to @droidbg) - Added
useMaterialStatesController(thanks to @AdamHavlicek)
0.20.2 - 2023-10-02 #
- Fixed key matching algorithm incorrectly not checking all keys if a 0 or a NaN is present (thanks to @AlexDochioiu)
0.20.1 - 2023-08-29 #
useListenableSelectornow supportsnulllisteners (thanks to @JWo1F)
0.20.0 - 2023-07-25 #
- Breaking:
keyscomparison has changed under the following conditions:- Change from
double.nantodouble.nanpreserves the state. - Change from
0.0to-0.0or vice versa does NOT preserve the state.
- Change from
- Added
useOnStreamChange(thanks to @jezsung)
0.19.0 - 2023-07-10 #
- Added
useSearchController(thanks to @snapsl) - Keys on
useCallbackare now optional, to matchuseMemoized(thanks to @jezsung) - Update
usePlatformBrightnessto stop relying on deprecated code
0.18.6 #
- Added korean translation (thanks to @sejun2)
- Add
useFocusScopeNodehook (thanks to @iamsahilsonawane)
0.18.5+1 #
Update links to the repository
0.18.5 #
- Added
useListenableSelector, similar touseListenable, for listening to aListenablebut rebuilding the widget only if a certain data has changed (thanks to @ronnieeeeee) - Added
useAutomaticKeepAlive(thanks to @DevNico) - Added
usePlatformBrightnessanduseOnPlatformBrightnessChangeto interact with platformBrightness(thanks to @AhmedLSayed9)
0.18.4 #
Upgrade to Flutter 3.0.0
0.18.3 #
Added onKeyEvent to useFocusNode (thanks to @kdelorey)
0.18.2+1 #
Improved the documentation (thanks to @Renni771)
0.18.2 #
- Allow null in
useListenable
0.18.1 #
- Added
useTransformationController, to create aTransformationController(thanks to @shrouxm) - Added
useAppLifecycleStateanduseOnAppLifecycleStateChangeto interact withAppLifecycleState(thanks to @francipvb)
0.18.0 #
-
Breaking:
useRefnow receive an initial value as parameter. To migrate, you can change:ObjectRef<int> ref = useRef<int>();to:
ObjectRef<int?> ref = useRef<int?>(null); -
Updated
useStream/useFutureto match the behavior ofStreamBuilder/FutureBuilderregarding initial values. -
Added a
reverseDurationparameter touseAnimationController
0.17.0 #
useFuture/useStream'sAsynsSnapshotnow correctly expose the StackTrace when there is an error.- added
useRefanduseCallback, similar to the React equivalents. initialDataofuseStreamanduseFutureis now optional.
0.16.0 #
Stable null-safety release
0.16.0-nullsafety.0 #
Migrated flutter_hooks to null-safety (special thanks to @DevNico for the help!)
0.15.0 #
- Added
usePageControllerto create aPageController
0.14.1 #
-
Increased the minimum version of the Flutter SDK required to match changes on
useFocusNodeThe minimum required is now 1.20.0 (the stable channel is at 1.20.4)
0.14.0 #
- added all
FocusNodeparameters touseFocusNode - Fixed a bug where on hot-reload, a
HookWidgetcould potentially not rebuild - Allow hooks to integrate with the devtool using the
DiagnosticableAPI, and implement it for all built-in hooks.
0.13.1 #
useIsMountednow returns a function instead of a callable class.
0.13.0 #
- Added
useIsMountedto determine whether a widget was destroyed or not (thanks to @davidmartos96)
0.12.0 #
- Added
useScrollControllerto create aScrollController - added
useTabControllerto create aTabController(thanks to @Albert221)
0.11.0 #
Breaking change:
- Removed
HookState.didBuild. If you still need it, useaddPostFrameCallbackorFuture.microtask.
Non-breaking changes:
-
Fix a bug where the order in which hooks are disposed is incorrect.
-
It is now allowed to rebuild a
HookWidgetwith more/less hooks than previously. Example:Widget build(context) { useSomething(); if (condition) { return Container(); } useSomething() return Container(); } -
Deprecated
Hook.usein favor of a new short-handuse. Before:Hook.use(MyHook());After:
use(MyHook());
0.10.0 #
Breaking change:
-
The order in which hooks are disposed has been reversed.
Consider:
useSomething(); useSomethingElse();Before, the
useSomethingwas disposed beforeuseSomethingElse. Now,useSomethingElseis disposed before theuseSomething.The reason for this change is for cases like:
// Creates an AnimationController final animationController = useAnimationController(); // Immediately listen to the AnimationController useListenable(animationController);Before, when the widget was disposed, this caused an exception as
useListenableunsubscribed to theAnimationControllerafter itsdisposemethod was called.
Non-breaking changes:
- Added a way for hooks to potentially abort a widget rebuild.
- Added
StatefulHookWidget, aStatefulWidgetthat can use hooks inside itsbuildmethod.
0.9.0 #
- Added a
deactivatelife-cycle toHookState
0.8.0+1 #
- Fixed link to "Existing hooks" in
README.md.
0.8.0: #
Added useFocusNode
0.7.0: #
- Added
useTextEditingController, thanks to simolus3!
0.6.1: #
- Added
useReassemblehook, thanks to @SahandAkbarzadeh
0.6.0: #
- Make hooks compatible with newer flutter stable version 1.7.8-hotfix.2.
0.4.0: #
- Make hooks compatible with newer flutter version. (see https://groups.google.com/forum/#!topic/flutter-announce/hp1RNIgej38)
0.3.0: #
- NEW:
usePrevious, a hook that returns the previous argument is received. - NEW: it is now impossible to call
inheritFromWidgetOfExactTypeinsideinitHookof hooks. This forces authors to handle value updates. - FIX: use List