ApiVersionHeaderInterceptor class
Response Interceptor for reading the compatibility of API with the App version
It will compare the api version from header with the app version on each api response
Version Strings should look like 1.0.0
headerApiVersionKey is the header namer that will be read from the response
default value is x-api-version
minSupportedVersion is the minimal supported version level that will return a CompatibleVersion. Can be major
,minor
or fix
default value is minor
streamController is the StreamController which needs to be passed to the Interceptor Results of the search will be added to its stream, they will be extensions of CompatibilityResult Results can be CompatibleVersion or IncompatibleVersion
Constructors
-
ApiVersionHeaderInterceptor({String headerApiVersionKey = defaultApiVersionKey, VersionSupportType minSupportedVersion = VersionSupportType.minor, required StreamController<
CompatibilityResult> streamController, required String appVersion})
Properties
- appVersion → String
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headerApiVersionKey → String
-
final
- minSupportedVersion → VersionSupportType
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
streamController
→ StreamController<
CompatibilityResult> -
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onError(
DioError err, ErrorInterceptorHandler handler) → void -
The callback will be executed on error.
inherited
-
onRequest(
RequestOptions options, RequestInterceptorHandler handler) → void -
The callback will be executed before the request is initiated.
inherited
-
onResponse(
Response response, ResponseInterceptorHandler handler) → void -
The callback will be executed on success.
If you want to continue the response, call
handler.next
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited