onRequest method
Called when the request is about to be sent.
Implementation
@override
Future<void> onRequest(
RequestOptions options,
RequestInterceptorHandler handler,
) async {
if (storage.isOpen()) {
final token = storage.getData(key: authKey);
final Map<String, dynamic>? authHeader = authHeadersBuilder(token);
if (authHeader != null) {
options.headers.addAll(authHeader);
}
}
super.onRequest(options, handler);
}