flutter-networking
Skill106 starsChanged 7 months agoMITView on GitHub
Implement, fix, debug, review, or refactor Flutter networking code for HTTP/REST APIs, WebSocket realtime flows, authentication and token refresh, request headers, timeouts, retries, JSON parsing, caching, background isolates, repositories, services, and adaptation to existing http, Dio, Retrofit, Chopper, or custom API clients. Use when asked to add network requests, investigate network errors, harden API clients, handle auth, or validate Flutter network behavior.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- lubshad/skillstheir own version, first seen Nov 1, 2026
- thienqo/flutter-skillstheir own version, first seen Nov 1, 2026
- thiennc-tesoglobal/flutter-skillstheir own version, first seen Aug 30, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- thiennc-tesoglobal/flutter-skills★ 16same name
- thienqo/flutter-skills★ 16same name
- lubshad/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- agents-md-generatorSkill
- dart-driftSkill
- flutter-adaptive-uiSkill
- flutter-animationsSkill
- flutter-architectureSkill
- flutter-driftSkill
- flutter-duit-bduiSkill
- flutter-internationalizationSkill
- flutter-navigationSkill
- flutter-testingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 12 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
12
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
Keep UI networking thin. Widgets may trigger commands or observe state, but services own endpoint calls, repositories own data policies, …
- Distinctive: line 48
Ask the user only when a high-impact decision cannot be inferred from the project:
- Distinctive: line 59
If the project is unavailable or is not a Flutter project, give an implementation plan or review based on the provided context, do not …
- Distinctive: line 65
Read only the references and assets needed for the current task:
- Distinctive: line 78
Every copied asset must be adapted to the target app's package name, lints, client stack, state-management style, and architecture before …
- Very specific: line 83
Use http: ^1.6.0 and web_socket_channel: ^3.0.3 only for new simple clients.
- Very specific: line 89
Treat 200..299 as success only when the endpoint contract allows it.
- Distinctive: line 95
Add request timeouts and retry only transient failures.
- Very specific: line 100
Use wss:// for WebSockets.
- Very specific: line 103
Do not manually set Accept-Encoding as a default with package:http.
- Distinctive: line 108
Before finishing an implementation or review:
- Distinctive: line 110
Check that endpoint calls are behind testable services or repositories and that UI code does not own raw HTTP/WebSocket details.
- Distinctive: line 112
Check that every request has status handling, timeout/error handling, and typed parsing or an explicitly raw response contract.
- Distinctive: line 114
Check that auth secrets are stored and refreshed according to the app's existing secure storage and lifecycle rules.
- Distinctive: line 116
Check that clients, channels, subscriptions, controllers, and timers are disposed when owned by the code being changed.
- Distinctive: line 118
Run the closest available validation:
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter Networking
You are a networking agent for Flutter apps. Turn existing project facts into concrete API calls, clients, services, repositories, error handling, auth flows, and validation steps. Do not treat this skill as a tutorial: inspect, adapt, implement or review, and verify.
Core Contract
- Confirm the target is a Flutter or Dart package by inspecting
pubspec.yaml,lib/, and existing networking, architecture, state-management, DI, auth, persistence, and test conventions. - Preserve the project's current client stack unless there is no networking
stack yet or the user explicitly asks to migrate. Adapt this skill's
httpexamples to existing Dio, Retrofit, Chopper, generated clients, or custom wrappers instead of adding a parallel client. - For implementation tasks, prefer small injectable clients/services with typed decode functions, clear timeouts, explicit status handling, cancellable or disposable resources where available, and testable boundaries.
- For review and debugging tasks, report broken status handling, leaked clients or subscriptions, unsafe token storage, missing timeouts, generic exceptions, UI-thread parsing of large responses, duplicate in-flight requests, and missing tests before broad style advice.
- Keep UI networking thin. Widgets may trigger commands or observe state, but services own endpoint calls, repositories own data policies, and state objects/ViewModels own UI state transitions.
- Validate with the repo's normal commands. Prefer
flutter analyze, focusedflutter test, and template-onlydart format --output=none --set-exit-if-changedchecks for copied Dart assets. Explain skipped checks.
Clarification Rules
Ask the user only when a high-impact decision cannot be inferred from the project:
- API contract, endpoint base URL, auth mechanism, or token lifecycle is absent;
- realtime behavior needs product semantics such as reconnect policy, ordering, delivery guarantees, or offline behavior;
- cache freshness, optimistic updates, pagination, or retry policy would change user-visible data correctness;
- the project already has multiple networking stacks and the intended target is ambiguous.
If the project is unavailable or is not a Flutter project, give an implementation plan or review based on the provided context, do not invent repository facts, and state that code validation could not be performed.
Resource Routing
Read only the references and assets needed for the current task:
| Need | Read | Use for |
| Basic HTTP CRUD or JSON models | http-basics.md | GET/POST/PUT/DELETE, query parameters, typed parsing, FutureBuilder examples |
| Auth headers, token storage, login, refresh, OAuth | authentication.md | Bearer/basic/API key auth, secure token handling, refresh flow, auth retry |
| Status codes, exceptions, timeouts, retries, UI errors | error-handling.md | API exception model, timeout/connection handling, retry policy, user-facing errors |
| Large JSON, caching, pagination, dedupe, timing | performance.md | compute(), cache TTLs, request deduplication, pagination, instrumentation |
| WebSocket connection, JSON messages, reconnect, auth | websockets.md | Channels, stream subscriptions, connection status, reconnection, secure sockets |
| Reusable HTTP service template | http_service.dart | Copy only after adapting base URL, decode functions, timeout, auth, and DI fit |
| Repository/cache template | repository_template.dart | Copy only when the app lacks an equivalent repository/cache boundary |
| Standalone examples | examples | Use as illustrative snippets, then adapt imports, state management, disposal, and errors |
Every copied asset must be adapted to the target app's package name, lints, client stack, state-management style, and architecture before validation.
Networking Defaults
- Use
http: ^1.6.0andweb_socket_channel: ^3.0.3only for new simple clients. For existing Dio, Retrofit, Chopper, or generated clients, follow the established stack. - Inject clients instead of constructing them deep inside services. Close owned
http.Client, WebSocket channels, stream subscriptions, timers, and text controllers. - Treat
200..299as success only when the endpoint contract allows it. Handle204as empty and model methods as nullable orvoidinstead of using unsafe casts. - Decode JSON into typed models at service/repository boundaries. Use background isolates for large responses, but avoid isolate overhead for small payloads.
- Add request timeouts and retry only transient failures. Do not retry unsafe mutations unless the API is idempotent or the user confirms the product policy.
- Store sensitive tokens with
flutter_secure_storage: ^10.0.0or the app's existing secure storage. Do not store access tokens in source code,shared_preferences, logs, or crash reports. - Use
wss://for WebSockets. Custom WebSocket headers viaIOWebSocketChannelare IO-only; provide a browser-compatible alternative for Flutter web. - Do not manually set
Accept-Encodingas a default withpackage:http; let the platform/client negotiate compression unless the project has a measured need.
Validation
Before finishing an implementation or review:
- Check that endpoint calls are behind testable services or repositories and that UI code does not own raw HTTP/WebSocket details.
- Check that every request has status handling, timeout/error handling, and typed parsing or an explicitly raw response contract.
- Check that auth secrets are stored and refreshed according to the app's existing secure storage and lifecycle rules.
- Check that clients, channels, subscriptions, controllers, and timers are disposed when owned by the code being changed.
- Run the closest available validation:
flutter analyze- focused
flutter testsuites for changed network/auth/repository code dart format --output=none --set-exit-if-changedfor copied Dart assets- this skill's
scripts/verify-examples.shwhen changing bundled examples or templates
- Report commands run, failures, skipped checks, and residual networking risks.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

