JsFetchOptions class
Opt-in native Fetch with streaming responses and multipart bodies. Web uses the browser's own Fetch API and resource policies.
Constructors
- JsFetchOptions({Duration? timeout, Duration headersTimeout = const Duration(seconds: 30), Duration? bodyIdleTimeout = const Duration(seconds: 30), int maxConcurrentRequests = 16, int maxRequestBytes = 8 * 1024 * 1024, int maxTotalBufferedBytes = 32 * 1024 * 1024, Duration? uploadIdleTimeout = const Duration(seconds: 30), int? maxResponseBytes, int maxBufferedBodyBytes = 8 * 1024 * 1024, int maxCloneBufferBytes = 8 * 1024 * 1024, int maxFormDataParts = 1024, int maxMultipartHeaderBytes = 16 * 1024, int maxMultipartPartBytes = 8 * 1024 * 1024, int maxRedirects = 20, Uri? baseUrl, bool allowRequest(Uri url)?, JsFetchTransport? transport})
-
const
Properties
- allowRequest → bool Function(Uri url)?
-
Optional policy checked before every request, including every redirect.
final
- baseUrl → Uri?
-
final
- bodyIdleTimeout → Duration?
-
Maximum wait for the next network chunk while a reader demands data.
Paused consumers do not count as network inactivity. Null disables it.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headersTimeout → Duration
-
Deadline for response headers, including redirects.
final
- maxBufferedBodyBytes → int
-
Limit for text/json/bytes/arrayBuffer/blob/formData aggregation.
final
- maxCloneBufferBytes → int
-
Maximum queued bytes per slow branch created by Response/Request.clone().
final
- maxConcurrentRequests → int
-
final
- maxFormDataParts → int
-
final
- maxMultipartHeaderBytes → int
-
final
- maxMultipartPartBytes → int
-
Maximum buffered bytes per part for incremental formDataParts().
final
- maxRedirects → int
-
final
- maxRequestBytes → int
-
final
- maxResponseBytes → int?
-
Optional cumulative response limit; null permits long-lived streams.
final
- maxTotalBufferedBytes → int
-
Aggregate limit for buffers retained by the native transport bridge.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → Duration?
-
Total deadline, including redirects and reading the response body.
final
- transport → JsFetchTransport?
-
Borrowed transport. JSF cancels its requests but does not close this object.
A null value creates a runtime-owned dart:io transport.
final
- uploadIdleTimeout → Duration?
-
Maximum time waiting for the next chunk requested from an upload producer.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited