xuelongqy/flutter_easy_refresh/easy-refresh-nested-scroll
Claude Code and agent skill by xuelongqy/flutter_easy_refresh
- community
Checking that the SKILL.md file is still in the repository.
Integrate easy_refresh with NestedScrollView, SliverAppBar and TabBarView. Use for page versus per-tab refresh/load ownership, nested physics and locators, or a secondary Header in the official Flutter NestedScrollView.
Install
npx vskill@latest install xuelongqy/flutter_easy_refresh/easy-refresh-nested-scrollSKILL.md
The same SKILL.md was published earlier as xuelongqy/flutter_easy_refresh/easy-refresh-nested-scroll.
Nested scrolling with EasyRefresh
For easy_refresh 4.x, Flutter >=3.47 and Dart ^3.13. Examples use the standalone material_ui package (^1.2.0); declare it directly in the consumer app.
Choose refresh ownership
| Requirement | Layout | |
|---|---|---|
| One page Header and one active-inner Footer | EasyRefresh.nested(onRefresh: ..., onLoad: ..., headerSliverBuilder: ..., body: ...). Route load to the active tab yourself when using tabs. | |
| Page Header, independent per-tab Footer/noMore | Outer nested refresh only (onLoad: null); each tab owns an EasyRefresh with onRefresh: null, NotRefreshHeader(), its own load callback and controller. | |
| Each tab owns its Header and Footer | Keep the outer nested integration for physics, with onRefresh: null and onLoad: null. Each tab owns its indicators; put locator Headers in that tab's inner slivers. |
Retain tab state (for example with AutomaticKeepAliveClientMixin) when noMore must survive switching tabs. Use unique PageStorageKeys for scroll positions; those keys alone do not preserve indicator state. On page refresh, update the appropriate tab data and reset each affected tab's Footer through its own controller. Do not attach one EasyRefreshController to multiple EasyRefresh instances. Page-level resetAfterRefresh does not reset separate child instances.
Physics and positioning
EasyRefresh.nested constructs Flutter's official NestedScrollView; it does not accept an existing nested widget as a wrapper. It sets nested physics, inserts HeaderLocator before outer slivers when onRefresh exists, and promotes a non-clamping Header to clamping/locator as needed. Its body inherits physics; do not insert another page HeaderLocator. It does not support bouncing refresh inside the nested body.
For ExtendedNestedScrollView or another custom nested view, use EasyRefresh.builder(isNested: true), assign the supplied physics to the nested view and its inner scrollable, and insert a page HeaderLocator.sliver(clearExtent: false) in the outer slivers when using a locator Header. Optional nestedOuterController and nestedInnerController must identify that host's outer and active inner controllers, not new unrelated ones. Secondary Header support here is limited to Flutter's official host.
For a page-level Footer prefer ClassicFooter's default infinite load (clamping: false, infiniteOffset: 70). Clamping plus infiniteOffset: null cannot enter the nested overscroll needed to load. Clamping plus non-null infiniteOffset is invalid even outside a nested layout.
Complete official nested example
The inner Builder supplies a context below the nested host for the overlap handle. Preserve this relationship when moving the body into a tab. If an awaited repository call replaces the delay, catch expected failures and return IndicatorResult.fail; use resetAfterRefresh false with an explicit successful Footer reset if a failed refresh must retain the end-of-list state.
Official nested secondary Header
The owner creates/disposes the controller passed to this standalone widget factory. The constructor inserts the Header locator. This example has no pinned app bar; when adding one, retain the overlap pattern above. Set an explicit dimension larger than the secondary trigger; for a full panel derive it from bounded layout constraints, not an unbounded scroll child.
Secondary needs a clamping Header, a non-null refresh callback, and no infinite offset. Its trigger must exceed the base trigger and its dimension must exceed the secondary trigger. Use openHeaderSecondary/closeHeaderSecondary for programmatic actions; with the builder constructor explicitly set isNested true before opening. While open, the Header owns vertical drag gestures. Retracting 70 logical pixels (default secondaryCloseTriggerOffset) closes on release; shorter drags spring back, and taps keep it open. Handle navigation/back using the controller and a PopScope appropriate to the consumer route.
Verify collapsed/expanded app bar, refresh at the global top, load at the active inner bottom, retained tab switching, independent noMore, and secondary open/close followed by a normal refresh. Do not claim ExtendedNestedScrollView secondary support from a passing official NestedScrollView test.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/easy_refresh/skills/easy-refresh-nested-scroll/SKILL.md
Popularity
- Repository stars
- 4,069
- Repository forks
- 653
- 7-day trend score
- 47
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/xuelongqy/flutter_easy_refresh/easy-refresh-nested-scroll)