{"id":13683893,"url":"https://github.com/wasabeef/flutter_use","last_synced_at":"2025-04-03T21:12:30.436Z","repository":{"id":40435348,"uuid":"422171172","full_name":"wasabeef/flutter_use","owner":"wasabeef","description":"Play Flutter Hooks.","archived":false,"fork":false,"pushed_at":"2024-10-03T19:28:04.000Z","size":365,"stargazers_count":213,"open_issues_count":13,"forks_count":17,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-11T08:10:41.207Z","etag":null,"topics":["dart","flutter","flutter-hooks","react-hooks"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wasabeef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"wasabeef","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-10-28T11:06:28.000Z","updated_at":"2024-09-26T18:25:33.000Z","dependencies_parsed_at":"2023-12-21T19:09:48.742Z","dependency_job_id":"ba7621fc-d586-49ea-88eb-7ea408e3161d","html_url":"https://github.com/wasabeef/flutter_use","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasabeef%2Fflutter_use","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasabeef%2Fflutter_use/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasabeef%2Fflutter_use/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasabeef%2Fflutter_use/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wasabeef","download_url":"https://codeload.github.com/wasabeef/flutter_use/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247078862,"owners_count":20879952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","flutter-hooks","react-hooks"],"created_at":"2024-08-02T14:00:20.014Z","updated_at":"2025-04-03T21:12:30.422Z","avatar_url":"https://github.com/wasabeef.png","language":"Dart","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/wasabeef/flutter_use/raw/main/art/flutter_use_logo.png\" width=\"480px\" alt=\"flutter_use\" /\u003e\n  \u003cdiv\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://pub.dartlang.org/packages/flutter_use\"\u003e\n      \u003cimg src=\"https://img.shields.io/pub/v/flutter_use.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pub.dev/packages/flutter_lints\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/style-flutter__lints-40c4ff.svg\" alt=\"flutter_lints\" /\u003e\n    \u003c/a\u003e\n    \u003cbr /\u003e\n    \u003csup style=\"font-size: 2px;\"\u003eInspired by \u003ca href=\"https://github.com/streamich/react-use\"\u003ereact-use\u003c/a\u003e.\u003c/sup\u003e\n    \u003cbr /\u003e\n  \u003c/div\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n\u003c/div\u003e\n\n\n\u003cdiv align=\"center\"\u003e\n  \u003cbr /\u003e\n  \u003cpre\u003eflutter pub add \u003ca href=\"https://pub.dev/packages/flutter_use\"\u003eflutter_use\u003c/a\u003e\u003c/pre\u003e\n  \u003cbr /\u003e\n\u003c/div\u003e\n\n\n- **Sensors**\n  - [`useBattery`](./docs/useBattery.md) \u0026mdash; tracks device battery state. [![battery_plus](https://img.shields.io/badge/required-battery__plus-brightgreen)](https://pub.dev/packages/battery_plus)\n  - [`useGeolocation`](./docs/useGeolocation.md) \u0026mdash; tracks geo location and permission state of user's device. [![geolocator](https://img.shields.io/badge/required-geolocator-brightgreen)](https://pub.dev/packages/geolocator)\n  - [`useNetworkState`](./docs/useNetworkState.md) \u0026mdash; tracks the state of apps network connection. [![connectivity_plus](https://img.shields.io/badge/required-connectivity__plus-brightgreen)](https://pub.dev/packages/connectivity_plus)\n  - [`useAccelerometer`](./docs/useAccelerometer.md), [`useUserAccelerometer`](./docs/useUserAccelerometer.md), [`useGyroscope`](./docs/useGyroscope.md), and [`useMagnetometer`](./docs/useMagnetometer.md) \u0026mdash; tracks accelerometer, gyroscope, and magnetometer sensors state of user's device. [![sensors_plus](https://img.shields.io/badge/required-sensors__plus-brightgreen)](https://pub.dev/packages/sensors_plus)\n  - [`useOrientation`](./docs/useOrientation.md) \u0026mdash; tracks state of device's screen orientation.\n  - [`useOrientationFn`](./docs/useOrientationFn.md) \u0026mdash; calls given function changed screen orientation of user's device.\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n- **UI**\n  - [`useAudio`](./docs/useAudio.md) \u0026mdash; plays audio and exposes its controls. [![just_audio](https://img.shields.io/badge/required-just__audio-brightgreen)](https://pub.dev/packages/just_audio)\n  - [`useAssetVideo`](./docs/useAssetVideo.md) and [`useNetworkVideo`](./docs/useNetworkVideo.md) \u0026mdash; 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)\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n- **Animations**\n  - [`useInterval`](./docs/useInterval.md) \u0026mdash; re-builds component on a set interval using [`Timer.periodic`](https://api.dart.dev/stable/2.14.4/dart-async/Timer/Timer.periodic.html). [![][img-demo]](https://dartpad.dev/?id=d4ce8c315a0157ad18257886d661c8b9\u0026null_safety=true)\n  - [`useTimeout`](./docs/useTimeout.md) \u0026mdash; re-builds component after a timeout. [![][img-demo]](https://dartpad.dev/?id=e1cb8d7045982ec96b0b314e9fb58202\u0026null_safety=true)\n  - [`useTimeoutFn`](./docs/useTimeoutFn.md) \u0026mdash; calls given function after a timeout. [![][img-demo]](https://dartpad.dev/?id=12449436914e1dec13c8f9c5cf63935b\u0026null_safety=true)\n  - [`useUpdate`](./docs/useUpdate.md) \u0026mdash; returns a callback, which re-builds component when called. [![][img-demo]](https://dartpad.dev/?id=27a74d481219749f532776a8e73f3464\u0026null_safety=true)\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n- **Side-effects**\n  - [`useFutureRetry`](./docs/useFutureRetry.md) \u0026mdash; [`useFuture`](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useFuture.html) with an additional retry method. [![][img-demo]](https://dartpad.dev/?id=ab910cc4170f5e8746229cc958ba845c\u0026null_safety=true)\n  - [`useDebounce`](./docs/useDebounce.md) \u0026mdash; debounces a function. [![][img-demo]](https://dartpad.dev/?id=977ee00fc30da8f0dd1888f6808114eb\u0026null_safety=true)\n  - [`useError`](./docs/useError.md) \u0026mdash; error dispatcher. [![][img-demo]](https://dartpad.dev/?id=8e8e4876d546dd38517cb833ee694359\u0026null_safety=true)\n  - [`useException`](./docs/useException.md) \u0026mdash; exception dispatcher. [![][img-demo]](https://dartpad.dev/?id=98580d1987dcae38ea0f27ee67a0d089\u0026null_safety=true)\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n- **Lifecycles**\n  - [`useEffectOnce`](./docs/useEffectOnce.md) \u0026mdash; a modified [`useEffect`](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useEffect.html) hook that only runs once. [![][img-demo]](https://dartpad.dev/?id=adec4d3a92f52bc8a40dc55ff330d2ab\u0026null_safety=true)\n  - [`useLifecycles`](./docs/useLifecycles.md) \u0026mdash; calls `mount` and `unmount` callbacks.\n  - [`useLogger`](./docs/useLogger.md) \u0026mdash; logs in console as component goes through life-cycles. [![][img-demo]](https://dartpad.dev/?id=c72c9ab0fa46f93dd266f6557a29a3ed\u0026null_safety=true)\n  - [`useMount`](./docs/useMount.md) \u0026mdash; calls `mount` callbacks. [![][img-demo]](https://dartpad.dev/?id=aa25e9bc3913779fcc795bef2bdc8d39\u0026null_safety=true)\n  - [`useUnmount`](./docs/useUnmount.md) \u0026mdash; calls `unmount` callbacks.  [![][img-demo]](https://dartpad.dev/?id=aa25e9bc3913779fcc795bef2bdc8d39\u0026null_safety=true)\n  - [`useUpdateEffect`](./docs/useUpdateEffect.md) \u0026mdash; run an `effect` only on updates. [![][img-demo]](https://dartpad.dev/?id=724fee007fe78419fde61f185b83095b\u0026null_safety=true)\n  - [`useCustomCompareEffect`](./docs/useCustomCompareEffect.md) \u0026mdash; run an `effect` depending on deep comparison of its dependencies. [![][img-demo]](https://dartpad.dev/?id=27146b5ca9189664e39ad4dfe9b08abe\u0026null_safety=true)\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n- **State**\n  - [`useDefault`](./docs/useDefault.md) \u0026mdash; returns the default value when state is `null`. [![][img-demo]](https://dartpad.dev/?id=6511219165b2e5c64ec8890b69633da6\u0026null_safety=true)\n  - [`useLatest`](./docs/useLatest.md) \u0026mdash; returns the latest state or props. [![][img-demo]](https://dartpad.dev/?id=2a76f5b16c2f27d11c023a140f38ce33\u0026null_safety=true)\n  - [`usePreviousDistinct`](./docs/usePreviousDistinct.md) \u0026mdash; like [`usePrevious`](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/usePrevious.html) but with a predicate to determine if `previous` should update. [![][img-demo]](https://dartpad.dev/?id=86e0e29f8198095dbd0d68a736c671bb\u0026null_safety=true)\n  - [`useStateList`](./docs/useStateList.md) \u0026mdash; circularly iterates over an array. [![][img-demo]](https://dartpad.dev/?id=5761442418062838b04cbe21a36be586\u0026null_safety=true)\n  - [`useToggle` and `useBoolean`](./docs/useToggle.md) \u0026mdash; tracks state of a boolean. [![][img-demo]](https://dartpad.dev/?id=7e070264db2566b3c990c403dd61c3ff\u0026null_safety=true)\n  - [`useCounter` and `useNumber`](./docs/useCounter.md) \u0026mdash; tracks state of a number.  [![][img-demo]](https://dartpad.dev/?id=5ee82acd2f1947b2d0ca02da4ab327b8\u0026null_safety=true)\n  - [`useList`](./docs/useList.md) \u0026mdash; tracks state of an array. [![][img-demo]](https://dartpad.dev/?id=e04b584b8ab67492a1024ea7dd9adcbb\u0026null_safety=true)\n  - [`useMap`](./docs/useMap.md) \u0026mdash; tracks state of a map. [![][img-demo]](https://dartpad.dev/?id=325b4737e78d40463fc0f3d3cc317b35\u0026null_safety=true)\n  - [`useSet`](./docs/useSet.md) \u0026mdash; tracks state of a Set. [![][img-demo]](https://dartpad.dev/?id=3d1199828a54b19c526a26a6c0021293\u0026null_safety=true)\n  - [`useTextFormValidator`](./docs/useTextFormValidator.md) \u0026mdash; tracks state of an object. [![][img-demo]](https://dartpad.dev/?id=23dee1c153a8a9e455d463584537256e\u0026null_safety=true)\n  - [`useFirstMountState`](./docs/useFirstMountState.md) \u0026mdash; check if current build is first. [![][img-demo]](https://dartpad.dev/?id=c9b6853d726ae29dcf902efcf7e85dc6\u0026null_safety=true)\n  - [`useBuildsCount`](./docs/useBuildsCount.md) \u0026mdash; count component builds. [![][img-demo]](https://dartpad.dev/?id=d54979d95910abd48054547202e20c12\u0026null_safety=true)\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n- \u003cdetails\u003e\u003csummary\u003e\u003cb\u003eTBD\u003c/b\u003e\u003c/summary\u003e\u003cdiv\u003e\n  \n  - `useCopyToClipboard` \u0026mdash; copies text to clipboard.\n  - `useEvent` \u0026mdash; subscribe to events.\n  - `useScroll` \u0026mdash; tracks a widget's scroll position.\n  - `useScrolling` \u0026mdash; tracks whether widget is scrolling.\n  - `useFullscreen` \u0026mdash; display an element or video full-screen.\n  - `useClickAway`\u0026mdash; triggers callback when user clicks outside target area.\n  - `usePageLeave` \u0026mdash; triggers when mouse leaves page boundaries.\n  - `usePermission` \u0026mdash; query permission status for apps APIs.\n  - `useMethods` \u0026mdash; neat alternative to `useReducer`.\n  - `useSetState` \u0026mdash; creates `setState` method which works like `this.setState`.\n  - `usePromise` \u0026mdash; resolves promise only while component is mounted.\n  - `useObservable` \u0026mdash; tracks latest value of an `Observable`.\n  - `useThrottle` and `useThrottleFn` \u0026mdash; throttles a function.\n  \n\u003c/div\u003e\u003c/details\u003e\n\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"./LICENSE\"\u003e\u003cstrong\u003eUnlicense\u003c/strong\u003e\u003c/a\u003e \u0026mdash; public domain.\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n\n[img-demo]: https://img.shields.io/badge/demo-%20%20%20%F0%9F%9A%80-green.svg\n","funding_links":["https://github.com/sponsors/wasabeef"],"categories":["Dart"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasabeef%2Fflutter_use","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwasabeef%2Fflutter_use","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasabeef%2Fflutter_use/lists"}