Last updated:
0 purchases
flutter use battery
Inspired by react-use.
flutter pub add flutter_usecopied to clipboard
Sensors
useBattery — tracks device battery state.
useGeolocation — tracks geo location and permission state of user's device.
useNetworkState — tracks the state of apps network connection.
useAccelerometer, useUserAccelerometer, useGyroscope, and 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.
UI
useAudio — plays audio and exposes its controls.
useAssetVideo and useNetworkVideo — plays video, tracks its state, and exposes playback controls.
Animations
useInterval — re-builds component on a set interval using Timer.periodic.
useTimeout — re-builds component after a timeout.
useTimeoutFn — calls given function after a timeout.
useUpdate — returns a callback, which re-builds component when called.
Side-effects
useFutureRetry — useFuture with an additional retry method.
useDebounce — debounces a function.
useError — error dispatcher.
useException — exception dispatcher.
Lifecycles
useEffectOnce — a modified useEffect hook that only runs once.
useLifecycles — calls mount and unmount callbacks.
useLogger — logs in console as component goes through life-cycles.
useMount — calls mount callbacks.
useUnmount — calls unmount callbacks.
useUpdateEffect — run an effect only on updates.
useCustomCompareEffect — run an effect depending on deep comparison of its dependencies.
State
useDefault — returns the default value when state is null.
useLatest — returns the latest state or props.
usePreviousDistinct — like usePrevious but with a predicate to determine if previous should update.
useStateList — circularly iterates over an array.
useToggle and useBoolean — tracks state of a boolean.
useCounter and 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.
TBD
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 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.
useThrottle and useThrottleFn — throttles a function.
Unlicense — public domain.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.