# flutter_use **Repository Path**: mirrors_wasabeef/flutter_use ## Basic Information - **Project Name**: flutter_use - **Description**: Play Flutter Hooks. - **Primary Language**: Unknown - **License**: Unlicense - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-12-18 - **Last Updated**: 2026-02-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
flutter_use

flutter_lints
Inspired by react-use.


A collection of Flutter Hooks inspired by React's `react-use` library. This monorepo contains multiple packages providing different categories of hooks for Flutter development. ## 📦 Packages | Package | Description | Version | | ------------------------------------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | **[`flutter_use`](./packages/basic)** | Core hooks library with essential utilities | [![pub package](https://img.shields.io/pub/v/flutter_use.svg)](https://pub.dev/packages/flutter_use) | | **[`flutter_use_audio`](./packages/audio)** | Audio playback and control hooks | [![pub package](https://img.shields.io/pub/v/flutter_use_audio.svg)](https://pub.dev/packages/flutter_use_audio) | | **[`flutter_use_battery`](./packages/battery)** | Battery state monitoring hooks | [![pub package](https://img.shields.io/pub/v/flutter_use_battery.svg)](https://pub.dev/packages/flutter_use_battery) | | **[`flutter_use_geolocation`](./packages/geolocation)** | Location and permission hooks | [![pub package](https://img.shields.io/pub/v/flutter_use_geolocation.svg)](https://pub.dev/packages/flutter_use_geolocation) | | **[`flutter_use_network_state`](./packages/network)** | Network connectivity hooks | [![pub package](https://img.shields.io/pub/v/flutter_use_network_state.svg)](https://pub.dev/packages/flutter_use_network_state) | | **[`flutter_use_sensors`](./packages/sensors)** | Device sensors hooks | [![pub package](https://img.shields.io/pub/v/flutter_use_sensors.svg)](https://pub.dev/packages/flutter_use_sensors) | | **[`flutter_use_video`](./packages/video)** | Video playbook hooks | [![pub package](https://img.shields.io/pub/v/flutter_use_video.svg)](https://pub.dev/packages/flutter_use_video) | ## 🚀 Installation For the core package: ```bash flutter pub add flutter_use ``` For specialized packages: ```bash flutter pub add flutter_use_audio # Audio hooks flutter pub add flutter_use_battery # Battery hooks # ... and so on ``` ## 🌐 Interactive Demo Site Try out all hooks with live examples at: **[https://wasabeef.github.io/flutter_use/](https://wasabeef.github.io/flutter_use/)** ## 📚 Hooks by Category ### 📱 Mobile-first Hooks _Core package: `flutter_use`_ - [`useAsync`](./docs/useAsync.md) — manages async operations with loading, data, and error states. - [`useDebounceFn`](./docs/useDebounceFn.md) — debounces function calls for better performance. - [`useInfiniteScroll`](./docs/useInfiniteScroll.md) — implements infinite scrolling with automatic loading. - [`useForm`](./docs/useForm.md) — comprehensive form state management with validation. - [`useKeyboard`](./docs/useKeyboard.md) — tracks keyboard visibility and manages layouts (mobile only). ### 🎭 State Management _Core package: `flutter_use`_ - [`useToggle` and `useBoolean`](./docs/useToggle.md) — tracks state of a boolean. - [`useCounter` and `useNumber`](./docs/useCounter.md) — tracks state of a number. - [`useList`](./docs/useList.md) — tracks state of an array. - [`useMap`](./docs/useMap.md) — tracks state of a map. - [`useSet`](./docs/useSet.md) — tracks state of a Set. - [`useStateList`](./docs/useStateList.md) — circularly iterates over an array. - [`useDefault`](./docs/useDefault.md) — returns the default value when state is `null`. - [`useLatest`](./docs/useLatest.md) — returns the latest state or props. - [`usePreviousDistinct`](./docs/usePreviousDistinct.md) — like [`usePrevious`](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/usePrevious.html) but with a predicate to determine if `previous` should update. - [`useTextFormValidator`](./docs/useTextFormValidator.md) — reactive form validation with real-time feedback. ### ⏱️ Timing & Animation _Core package: `flutter_use`_ - [`useInterval`](./docs/useInterval.md) — re-builds component on a set interval using [`Timer.periodic`](https://api.dart.dev/stable/2.14.4/dart-async/Timer/Timer.periodic.html). - [`useTimeout`](./docs/useTimeout.md) — re-builds component after a timeout. - [`useTimeoutFn`](./docs/useTimeoutFn.md) — calls given function after a timeout. - [`useUpdate`](./docs/useUpdate.md) — returns a callback, which re-builds component when called. ### 🔄 Side Effects & Performance _Core package: `flutter_use`_ - [`useFutureRetry`](./docs/useFutureRetry.md) — [`useFuture`](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useFuture.html) with an additional retry method. - [`useDebounce`](./docs/useDebounce.md) — debounces a function. - [`useThrottle`](./docs/useThrottle.md) — throttles a value to update at most once per duration. - [`useThrottleFn`](./docs/useThrottleFn.md) — throttles a function to execute at most once per duration. - [`useError`](./docs/useError.md) — error dispatcher. - [`useException`](./docs/useException.md) — exception dispatcher. ### 🎯 UI Interactions _Core package: `flutter_use`_ - [`useScroll`](./docs/useScroll.md) — tracks a widget's scroll position. - [`useScrolling`](./docs/useScrolling.md) — tracks whether widget is scrolling. - [`useClickAway`](./docs/useClickAway.md) — triggers callback when user clicks outside target area. - [`useCopyToClipboard`](./docs/useCopyToClipboard.md) — copies text to clipboard. ### ♻️ Lifecycle Management _Core package: `flutter_use`_ - [`useEffectOnce`](./docs/useEffectOnce.md) — a modified [`useEffect`](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useEffect.html) hook that only runs once. - [`useLifecycles`](./docs/useLifecycles.md) — calls `mount` and `unmount` callbacks. - [`useMount`](./docs/useMount.md) — calls `mount` callbacks. - [`useUnmount`](./docs/useUnmount.md) — calls `unmount` callbacks. - [`useUpdateEffect`](./docs/useUpdateEffect.md) — run an `effect` only on updates. - [`useCustomCompareEffect`](./docs/useCustomCompareEffect.md) — run an `effect` depending on deep comparison of its dependencies. - [`useFirstMountState`](./docs/useFirstMountState.md) — check if current build is first. - [`useBuildsCount`](./docs/useBuildsCount.md) — count component builds. ### 🎨 Development & Debugging _Core package: `flutter_use`_ - [`useLogger`](./docs/useLogger.md) — logs in console as component goes through life-cycles. ### 📱 Device Sensors _Package: `flutter_use_sensors`_ - [`useAccelerometer`](./docs/useAccelerometer.md), [`useUserAccelerometer`](./docs/useUserAccelerometer.md), [`useGyroscope`](./docs/useGyroscope.md), and [`useMagnetometer`](./docs/useMagnetometer.md) — tracks accelerometer, gyroscope, and magnetometer sensors. [![sensors_plus](https://img.shields.io/badge/required-sensors__plus-brightgreen)](https://pub.dev/packages/sensors_plus) _Core package: `flutter_use`_ - [`useOrientation`](./docs/useOrientation.md) — tracks state of device's screen orientation. - [`useOrientationFn`](./docs/useOrientationFn.md) — calls given function when screen orientation changes. ### 🔋 Device Information _Package: `flutter_use_battery`_ - [`useBattery`](./docs/useBattery.md) — tracks device battery state. [![battery_plus](https://img.shields.io/badge/required-battery__plus-brightgreen)](https://pub.dev/packages/battery_plus) _Package: `flutter_use_geolocation`_ - [`useGeolocation`](./docs/useGeolocation.md) — tracks geo location and permission state of user's device. [![geolocator](https://img.shields.io/badge/required-geolocator-brightgreen)](https://pub.dev/packages/geolocator) _Package: `flutter_use_network_state`_ - [`useNetworkState`](./docs/useNetworkState.md) — tracks the state of apps network connection. [![connectivity_plus](https://img.shields.io/badge/required-connectivity__plus-brightgreen)](https://pub.dev/packages/connectivity_plus) ### 🎵 Media _Package: `flutter_use_audio`_ - [`useAudio`](./docs/useAudio.md) — plays audio and exposes its controls. [![just_audio](https://img.shields.io/badge/required-just__audio-brightgreen)](https://pub.dev/packages/just_audio) _Package: `flutter_use_video`_ - [`useAssetVideo`](./docs/useAssetVideo.md) and [`useNetworkVideo`](./docs/useNetworkVideo.md) — plays video, tracks its state, and exposes playback controls. [![video_player](https://img.shields.io/badge/required-video__player-brightgreen)](https://pub.dev/packages/video_player) ## 🚧 Coming Soon - `useEvent` — subscribe to events. - `useFullscreen` — display an element or video full-screen. - `usePageLeave` — triggers when mouse leaves page boundaries. - `usePermission` — query permission status for apps APIs. - `useMethods` — neat alternative to `useReducer`. - `useSetState` — creates `setState` method which works like `this.setState`. - `usePromise` — resolves promise only while component is mounted. - `useObservable` — tracks latest value of an `Observable`.


Unlicense — public domain.