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
🚀 Installation
For the core package:
flutter pub add flutter_use
For specialized packages:
flutter pub add flutter_use_audio
flutter pub add flutter_use_battery
🌐 Interactive Demo Site
Try out all hooks with live examples at: https://wasabeef.github.io/flutter_use/
📚 Hooks by Category
📱 Mobile-first Hooks
Core package: flutter_use
useAsync — manages async operations with loading, data, and error states.
useDebounceFn — debounces function calls for better performance.
useInfiniteScroll — implements infinite scrolling with automatic loading.
useForm — comprehensive form state management with validation.
useKeyboard — tracks keyboard visibility and manages layouts (mobile only).
🎭 State Management
Core package: flutter_use
⏱️ Timing & Animation
Core package: flutter_use
🔄 Side Effects & Performance
Core package: flutter_use
🎯 UI Interactions
Core package: flutter_use
♻️ Lifecycle Management
Core package: flutter_use
🎨 Development & Debugging
Core package: flutter_use
useLogger — logs in console as component goes through life-cycles.
📱 Device Sensors
Package: flutter_use_sensors
Core package: flutter_use
🔋 Device Information
Package: flutter_use_battery
Package: flutter_use_geolocation
useGeolocation — tracks geo location and permission state of user's device.
Package: flutter_use_network_state
🎵 Media
Package: flutter_use_audio
useAudio — plays audio and exposes its controls.
Package: flutter_use_video
🚧 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.