Inspired by react-use.
flutter pub add flutter_use
useBattery— tracks device battery state.
useGeolocation— tracks geo location and permission state of user's device.
useNetworkState— tracks the state of apps network connection.
useMagnetometer— tracks accelerometer, gyroscope, and magnetometer sensors state of user's device.
useOrientation— tracks state of device's screen orientation.
useOrientationFn— calls given function changed screen orientation of user's device. <br/> <br/>
useEffectOnce— a modified
useEffecthook that only runs once.
useLogger— logs in console as component goes through life-cycles.
useUpdateEffect— run an
effectonly on updates.
useCustomCompareEffect— run an
effectdepending on deep comparison of its dependencies. <br/> <br/>
useDefault— returns the default value when state is
useLatest— returns the latest state or props.
usePreviousbut with a predicate to determine if
useStateList— circularly iterates over an array.
useBoolean— tracks state of a boolean.
useNumber— tracks state of a number.
useList— tracks state of an array.
useMap— tracks state of a map.
useSet— tracks state of a Set.
useTextFormValidator— tracks state of an object.
useFirstMountState— check if current build is first.
useBuildsCount— count component builds. <br/> <br/>
useCopyToClipboard— copies text to clipboard.
useEvent— subscribe to events.
useScroll— tracks a widget's scroll position.
useScrolling— tracks whether widget is scrolling.
useFullscreen— display an element or video full-screen.
useClickAway— triggers callback when user clicks outside target area.
usePageLeave— triggers when mouse leaves page boundaries.
usePermission— query permission status for apps APIs.
useMethods— neat alternative to
setStatemethod which works like
usePromise— resolves promise only while component is mounted.
useObservable— tracks latest value of an
useThrottleFn— throttles a function.
Unlicense — public domain.