mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
16 lines
556 B
Dart
16 lines
556 B
Dart
import 'dart:async';
|
|
import 'package:flutter/foundation.dart' show ValueGetter;
|
|
import 'package:http/http.dart' as http;
|
|
import 'package:http/testing.dart' as http;
|
|
|
|
import '../../../packages/flutter/test/services/image_data.dart';
|
|
|
|
// Returns a mock HTTP client that responds with an image to all requests.
|
|
ValueGetter<http.Client> createMockImageHttpClient = () {
|
|
return new http.MockClient((http.BaseRequest request) {
|
|
return new Future<http.Response>.value(
|
|
new http.Response.bytes(kTransparentImage, 200, request: request)
|
|
);
|
|
});
|
|
};
|