DioProvider class abstract

Provides access to the configured Dio instance

This prevents interceptors from losing configuration when they need to retry requests. Instead of creating new Dio instances, interceptors should use the injected provider to access the configured instance.

Example:

class MyInterceptor extends Interceptor {
  final DioProvider dioProvider;

  MyInterceptor(this.dioProvider);

  Future<Response> retry(RequestOptions options) {
    return dioProvider.dio.fetch(options); // ✅ Keeps all interceptors
  }
}
Implementers

Constructors

DioProvider()

Properties

dio Dio
Get the configured Dio instance
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited