DioFirebasePerformanceInterceptor class
Dio
client interceptor that hooks into request/response process
and calls Firebase Metric API in between. The HttpMetric
stored in RequestOptions.extra
field.
Additionally there is no good API of obtaining content length from interceptor API so we're "approximating" the byte length based on headers & request data. If you're not fine with this, you can provide your own implementation in the constructor
This interceptor might be counting parsing time into elapsed API call duration.
I am not fully aware of Dio
internal architecture.
Constructors
- DioFirebasePerformanceInterceptor({RequestContentLengthMethod requestContentLengthMethod = defaultRequestContentLength, ResponseContentLengthMethod responseContentLengthMethod = defaultResponseContentLength, RequestUrlBuilder requestUrlBuilder = defaultRequestUrl})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- requestContentLengthMethod → RequestContentLengthMethod
-
final
- requestUrlBuilder → RequestUrlBuilder
-
final
- responseContentLengthMethod → ResponseContentLengthMethod
-
final
- 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
-
onError(
DioError err, ErrorInterceptorHandler handler) → Future - Called when an exception was occurred during the request.
-
onRequest(
RequestOptions options, RequestInterceptorHandler handler) → Future - Called when the request is about to be sent.
-
onResponse(
Response response, ResponseInterceptorHandler handler) → Future - Called when the response is about to be resolved.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited