dio_auth_guard 0.2.1 copy "dio_auth_guard: ^0.2.1" to clipboard
dio_auth_guard: ^0.2.1 copied to clipboard

Automatically handles 401/403 responses in Dio — cancels all in-flight requests and navigates to a custom unauthenticated screen. Router-agnostic.

0.2.1 #

  • Inspector UI redesigned in dark mode
  • Expandable cards in list — tap to expand inline (no bottom sheet)
  • List shows only the endpoint path, not the full URL
  • Stats bar at top: Total / Success / Failed counts
  • Filter via popup menu (All / Success Only / Failed Only / Clear All)
  • Error reason shown on failure: error type + message (e.g. connectionTimeout)
  • Method badges and status badges use dark-themed accent colours
  • cURL section and response body shown inline with copy button
  • LogEntry now captures errorMessage and errorType from DioException

0.2.0 #

  • Added built-in API Inspector Screen
  • Full cURL command for every request with copy button
  • Request headers, body, response — vertical Postman-style layout
  • Filter logs: All / Success / Failed
  • Response type mismatch detection with clear field-level warnings
  • Max 100 logs with auto-rotation (oldest removed)
  • Auto-disabled in release mode (kDebugMode)
  • New: AuthGuardConfig.showInspector(context)
  • New: inspectorEnabled param in AuthGuardConfig.init()

0.0.1 #

  • Initial release
  • AuthGuard singleton with debounced 401/403 handling
  • CancelToken management for in-flight request cancellation
  • Router-agnostic navigation via onUnauthenticated callback or unauthWidget
  • AuthGuardModule for easy Dio interceptor registration and removal
  • AuthGuard.onLoginSuccess() and AuthGuard.onLogout() lifecycle hooks
14
likes
140
points
55
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Automatically handles 401/403 responses in Dio — cancels all in-flight requests and navigates to a custom unauthenticated screen. Router-agnostic.

Repository (GitHub)
View/report issues

Topics

#dio #authentication #network #interceptor #flutter

License

MIT (license)

Dependencies

dio, flutter

More

Packages that depend on dio_auth_guard