hooks_async_zone 0.1.0
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 #
HookZoneWidgetandStatefulHookZoneWidgetbase classes, plus the inlineHookZoneBuilder, that combineHookElementandZoneElementin a single widget — no need to hand-roll a customElementto useflutter_hooksalongsideasync_zone.useAsyncZone()hook that returns the surroundingAsyncZoneScope, sozone.use(future)can be called inside conditionals, loops, or after early returns (mirroring React'suse()semantics rather than the Rules of Hooks).- Sliver-shaped variants
SliverHookZoneWidget,SliverStatefulHookZoneWidget, andSliverHookZoneBuilderfor hook-enabled suspending widgets that must live directly inside aCustomScrollView. HookErrorZoneWidget<T>andStatefulHookErrorZoneWidget<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+ZoneElementwidget.