loadFlutterAssetWithServer method

Future<void> loadFlutterAssetWithServer(
  1. String uri,
  2. int port, {
  3. LoadRequestMethod method = LoadRequestMethod.get,
  4. Map<String, String> headers = const <String, String>{},
  5. Uint8List? body,
})

Load assets on the local server. LocalHostServer must be running.

method must be one of the supported HTTP methods in LoadRequestMethod.

If headers is not empty, its key-value pairs will be added as the headers for the request.

If body is not null, it will be added as the body for the request.

Throws an ArgumentError if uri has an empty scheme.

Implementation

Future<void> loadFlutterAssetWithServer(
  String uri,
  int port, {
  LoadRequestMethod method = LoadRequestMethod.get,
  Map<String, String> headers = const <String, String>{},
  Uint8List? body,
}) async {
  return super.loadRequest(Uri.parse('http://localhost:$port/$uri'),
      headers: headers, body: body, method: method);
}