hooks_async_zone 0.1.0 copy "hooks_async_zone: ^0.1.0" to clipboard
hooks_async_zone: ^0.1.0 copied to clipboard

flutter_hooks integration for async_zone. Provides HookZoneWidget and useAsyncZone so you can use Suspense-style async data alongside Flutter hooks.

0.1.0 #

Initial release.

Features #

  • HookZoneWidget and StatefulHookZoneWidget base classes, plus the inline HookZoneBuilder, that combine HookElement and ZoneElement in a single widget — no need to hand-roll a custom Element to use flutter_hooks alongside async_zone.
  • useAsyncZone() hook that returns the surrounding AsyncZoneScope, so zone.use(future) can be called inside conditionals, loops, or after early returns (mirroring React's use() semantics rather than the Rules of Hooks).
  • Sliver-shaped variants SliverHookZoneWidget, SliverStatefulHookZoneWidget, and SliverHookZoneBuilder for hook-enabled suspending widgets that must live directly inside a CustomScrollView.
  • HookErrorZoneWidget<T> and StatefulHookErrorZoneWidget<T> base classes for writing React-style error zones with hooks (getDerivedStateFromError, componentDidCatch, resetErrorBoundary, showErrorBoundary).
  • Element classes (HookZoneElement, StatefulHookZoneElement, sliver counterparts, and the hook error zone elements) are exported so consumers can extend them when composing with additional element mixins.

Documentation #

  • Bilingual README (English / Japanese) with hook usage examples and a side-by-side comparison against hand-rolling a HookElement + ZoneElement widget.
0
likes
160
points
71
downloads

Documentation

API reference

Publisher

verified publisherkyoheig3.jp

Weekly Downloads

flutter_hooks integration for async_zone. Provides HookZoneWidget and useAsyncZone so you can use Suspense-style async data alongside Flutter hooks.

Repository (GitHub)
View/report issues

Topics

#hooks #suspense #async #react #flutter-hooks

License

BSD-3-Clause (license)

Dependencies

async_zone, flutter, flutter_hooks

More

Packages that depend on hooks_async_zone