mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Add a compressionState value to HttpResponse mocks (#66679)
The Dart SDK now requires non-null enum values if the enum is used in an exhaustive switch statement on a non-nullable type. See https://github.com/flutter/flutter/issues/66674
This commit is contained in:
parent
3e8fb33c08
commit
e6b9b5efb7
@ -19,6 +19,7 @@ MockHttpClient createMockImageHttpClient(SecurityContext _) {
|
||||
when(request.close()).thenAnswer((_) => Future<HttpClientResponse>.value(response));
|
||||
when(response.contentLength).thenReturn(kTransparentImage.length);
|
||||
when(response.statusCode).thenReturn(HttpStatus.ok);
|
||||
when(response.compressionState).thenReturn(HttpClientResponseCompressionState.notCompressed);
|
||||
when(response.listen(any)).thenAnswer((Invocation invocation) {
|
||||
final void Function(List<int>) onData = invocation.positionalArguments[0] as void Function(List<int>);
|
||||
final void Function() onDone = invocation.namedArguments[#onDone] as void Function();
|
||||
|
Loading…
Reference in New Issue
Block a user