DioFirebasePerformanceInterceptor class
Dio
client interceptor that hooks into request/response process
and calls Firebase Metric API in between. The request key is calculated
based upon extra
field hash code which appears to be the same across
onRequest, onResponse and onError calls.
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})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- requestContentLengthMethod → RequestContentLengthMethod
-
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 - The callback will be executed on error.
-
onRequest(
RequestOptions options, RequestInterceptorHandler handler) → Future - The callback will be executed before the request is initiated.
-
onResponse(
Response response, ResponseInterceptorHandler handler) → Future -
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