use_request 0.3.0 copy "use_request: ^0.3.0" to clipboard
use_request: ^0.3.0 copied to clipboard

A Flutter useRequest-style async request management library based on dio, flutter_hooks, and Riverpod.

0.3.0 #

  • Fix: RequestCache 新增 LRU 淘汰策略(默认最大 256 条),防止长时间运行导致内存无限增长(Bug 10)。
  • Fix: CacheCoordinator 修正 SWR 语义——只配 cacheTime 不配 staleTime 时,缓存始终后台刷新(Bug 13)。
  • Fix: 轮询与分页(loadMoreParams)同时使用时,轮询优先使用 defaultParams 刷新首页,避免覆盖已累积的分页数据(Bug 15)。
  • Feat: RequestCache.removeWhere() 支持按模式批量清除缓存(如 key.startsWith('user-'))。
  • Fix: UseRequestState.copyWith 新增 clearParams/clearHasMore 标志位(Bug 1)。
  • Fix: defaultParams 仅在首次 build 时初始化,不再覆盖用户手动参数(Bug 2)。
  • Fix: PaginationHelpers.pageParams 通过内部计数器正确追踪页码(Bug 3)。
  • Fix: UseRequestMixin.initUseRequest 新增 onStateChange 回调以触发宿主 Widget 重建(Bug 4)。
  • Fix: loadMore()hasMore == false 时拒绝发起新请求(Bug 5)。
  • Fix: 所有生命周期回调(onSuccess/onError/onFinally)包裹 try-catch,异常不再中断请求流程(Bug 6)。
  • Fix: bindPendingRequest 补充 onSuccess/onError/onFinally 回调(Bug 7)。
  • Fix: UseRequestBuilder 引入 serviceKey 机制,避免闭包引用变化导致无限重建(Bug 8)。
  • Fix: refreshAsync 安全类型检查,非空 TParams 场景下回退到 defaultParams(Bug 9)。
  • Fix: cancel() 取消所有 key 的进行中请求,而非仅最后一个(Bug 11)。
  • Fix: AppFocusManager 不再将 inactive 状态视为 blur(Bug 12)。
  • Docs: onBeforeloadMore 场景下不触发的行为已补充文档说明(Bug 14)。

0.0.13 #

  • Fix: clear both loading and loadingMore on cancel, and make Hook/Riverpod consistently support no-params requests across auto-run, refreshDeps, polling, focus refresh, and reconnect refresh.
  • Fix: remove duplicate Riverpod auto requests when refreshDeps and ready replay overlap, and let UseRequestBuilder / UseRequestMixin render notifier state on the first frame instead of a synthetic empty state.
  • Fix: harden scheduler and cache utilities, including correct Debouncer.maxWait, non-cancelling leading debounce futures, correct Throttler behavior for leading:false, cancellable retry backoff, pending-cache overwrite safety, and UseRequestOptions.copyWith() explicit null clearing.
  • Test: add Hook, Riverpod, debounce, throttle, retry, cache, and options contract tests for the above edge cases.

0.0.12 #

  • Fix: hydrate fresh cache into Hook and Riverpod state on the first frame, so pages that remount can render cached data immediately instead of flashing default values before auto requests run.

0.0.11 #

  • Fix: pending cache subscribers now receive the in-flight result in both Hook and Riverpod implementations, instead of reusing the Future without updating local state.

0.0.10 #

  • Fix: refreshDeps now triggers auto refresh even when last/default params is null (no-params service), aligning with ahooks.

0.0.9 #

  • Fix: refreshDeps change detection now survives list reuse/mutation by hashing deps and copying snapshots.
  • Fix: refreshDeps changes while ready=false are replayed once ready=true (Hook + Riverpod).
  • Fix: Riverpod refreshDeps initial trigger actually fires (no pre-seeded deps).

0.0.8 #

  • Fix: allow refresh() to reuse a previous null params entry instead of throwing (both Hook and Riverpod).

0.0.7 #

  • Example: add an inline Quick Start snippet in example/lib/main.dart so pub.dev can render a meaningful Example tab.

0.0.6 #

  • Align docs with implementation: make UseRequestOptions timeouts effective when TParams=HttpRequestConfig.
  • Add uploadFile / downloadFile aliases to DioHttpAdapter to match README examples.
  • Unify ready semantics between Hook and Riverpod (ready=false gates auto/polling, manual run still works).
  • Fix example widget test to reflect the current demo app.

0.0.5 #

  • Optimize auto-request logic: allow auto-trigger when defaultParams is null (provided manual is false).
  • Docs: add minimalist usage example (Zero Configuration).

0.0.4 #

  • Reformat source to satisfy dart format and static analysis.
  • Upgrade dependencies to latest supported versions (flutter_hooks, flutter_riverpod), keeping Riverpod v3 compatibility via legacy API.

0.0.2 #

  • Implement active-key single-state semantics for fetchKey (stale key results no longer update state).
  • Fix Debouncer so new calls cancel previous pending futures instead of leaving them hanging.
  • Align Hook and Riverpod behaviors (retry callbacks, polling control, cancel semantics, cache consistency).
  • Improve polling lifecycle: ready/manual gating, visibility pause/resume on Web, and optional pollingRetryInterval auto-restore.
  • Rework DioHttpAdapter.request to support per-request timeouts and merged headers/query.
  • Enhance example demos (interactive polling controls, sidebar scroll fix, JSONPlaceholder PUT/PATCH safe id).
  • Docs/metadata: add bilingual README, pub badges, topics, and Flutter CI workflow.

0.0.1 #

  • Initial release.
1
likes
0
points
126
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter useRequest-style async request management library based on dio, flutter_hooks, and Riverpod.

Repository (GitHub)
View/report issues

Topics

#hooks #dio #riverpod #async #request

License

unknown (license)

Dependencies

dio, flutter, flutter_hooks, flutter_riverpod

More

Packages that depend on use_request