receiveFromFrontend method
Implementation
@override
void receiveFromFrontend(int? id, String method, Map<String, dynamic>? params) {
switch (method) {
case 'setCacheDisabled':
bool cacheDisabled = params?['cacheDisabled'];
if (cacheDisabled) {
HttpCacheController.mode = HttpCacheMode.NO_CACHE;
} else {
HttpCacheController.mode = _httpCacheOriginalMode;
}
sendToFrontend(id, null);
break;
case 'getResponseBody':
String requestId = params!['requestId'];
Uint8List? buffer = _responseBuffers[requestId];
sendToFrontend(id, JSONEncodableMap({
if (buffer != null) 'body': utf8.decode(buffer),
// True, if content was sent as base64.
'base64Encoded': false,
}));
break;
}
}