onRequest method
Called when the request is about to be sent.
Implementation
@override
Future<void> onRequest(options, handler) async {
await Future.delayed(const Duration(milliseconds: 350));
for (final key in dataMap.keys) {
if (options.path.contains(key)) {
return handler.resolve(
Response(
requestOptions: options,
data: dataMap[key],
),
);
}
}
return handler.next(options);
}