core/network/interceptors/ — Dio Interceptors

Community

Secure, resilient HTTP interceptors for Dio

AuthorVantoan252003
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill provides standardized Dio interceptors to centralize authentication, error translation, and request/response logging for Flutter apps, reducing duplicated network handling and improving reliability.

Core Features & Use Cases

  • Auth Interceptor: Attaches Bearer tokens to requests and coordinates a single concurrent token refresh with a retry queue for failed 401 requests.
  • Error Interceptor: Maps DioException types and HTTP status codes into app-level typed exceptions such as UnauthorizedException, TimeoutException, NotFoundException, BadRequestException, and ServerException.
  • Logging Interceptor: Emits request/response/error logs only in debug builds using kDebugMode to avoid leaking information in production.
  • Use Case: Integrate these interceptors in a Flutter client to transparently handle token expiry, provide consistent error semantics to data sources, and keep production logs silent.

Quick Start

Implement AuthInterceptor, ErrorInterceptor, and LoggingInterceptor as described to attach bearer tokens, perform a single token refresh with a queued retry mechanism on 401 responses, and map Dio exceptions to typed app errors while logging only in debug builds.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: core/network/interceptors/ — Dio Interceptors
Download link: https://github.com/Vantoan252003/Mozi/archive/main.zip#core-network-interceptors-dio-interceptors

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.