URLRequest constructor
URLRequest({
- bool? allowsCellularAccess,
- bool? allowsConstrainedNetworkAccess,
- bool? allowsExpensiveNetworkAccess,
- bool? assumesHTTP3Capable,
- URLRequestAttribution? attribution,
- Uint8List? body,
- URLRequestCachePolicy? cachePolicy,
- Map<
String, String> ? headers, - bool? httpShouldHandleCookies,
- bool? httpShouldUsePipelining,
- @Deprecated('Use allowsCellularAccess instead') bool? iosAllowsCellularAccess,
- @Deprecated('Use allowsConstrainedNetworkAccess instead') bool? iosAllowsConstrainedNetworkAccess,
- @Deprecated('Use allowsExpensiveNetworkAccess instead') bool? iosAllowsExpensiveNetworkAccess,
- @Deprecated('Use cachePolicy instead') IOSURLRequestCachePolicy? iosCachePolicy,
- @Deprecated('Use httpShouldHandleCookies instead') bool? iosHttpShouldHandleCookies,
- @Deprecated('Use httpShouldUsePipelining instead') bool? iosHttpShouldUsePipelining,
- @Deprecated('Use mainDocumentURL instead') Uri? iosMainDocumentURL,
- @Deprecated('Use networkServiceType instead') IOSURLRequestNetworkServiceType? iosNetworkServiceType,
- @Deprecated('Use timeoutInterval instead') double? iosTimeoutInterval,
- WebUri? mainDocumentURL,
- String? method,
- URLRequestNetworkServiceType? networkServiceType,
- double? timeoutInterval,
- WebUri? url,
Implementation
URLRequest(
{this.allowsCellularAccess,
this.allowsConstrainedNetworkAccess,
this.allowsExpensiveNetworkAccess,
this.assumesHTTP3Capable,
this.attribution,
this.body,
this.cachePolicy,
this.headers,
this.httpShouldHandleCookies,
this.httpShouldUsePipelining,
@Deprecated('Use allowsCellularAccess instead')
this.iosAllowsCellularAccess,
@Deprecated('Use allowsConstrainedNetworkAccess instead')
this.iosAllowsConstrainedNetworkAccess,
@Deprecated('Use allowsExpensiveNetworkAccess instead')
this.iosAllowsExpensiveNetworkAccess,
@Deprecated('Use cachePolicy instead') this.iosCachePolicy,
@Deprecated('Use httpShouldHandleCookies instead')
this.iosHttpShouldHandleCookies,
@Deprecated('Use httpShouldUsePipelining instead')
this.iosHttpShouldUsePipelining,
@Deprecated('Use mainDocumentURL instead') this.iosMainDocumentURL,
@Deprecated('Use networkServiceType instead') this.iosNetworkServiceType,
@Deprecated('Use timeoutInterval instead') this.iosTimeoutInterval,
this.mainDocumentURL,
this.method,
this.networkServiceType,
this.timeoutInterval,
this.url}) {
allowsCellularAccess = allowsCellularAccess ?? iosAllowsCellularAccess;
allowsConstrainedNetworkAccess =
allowsConstrainedNetworkAccess ?? iosAllowsConstrainedNetworkAccess;
allowsExpensiveNetworkAccess =
allowsExpensiveNetworkAccess ?? iosAllowsExpensiveNetworkAccess;
cachePolicy = cachePolicy ??
URLRequestCachePolicy.fromNativeValue(iosCachePolicy?.toNativeValue());
httpShouldHandleCookies =
httpShouldHandleCookies ?? iosHttpShouldHandleCookies;
httpShouldUsePipelining =
httpShouldUsePipelining ?? iosHttpShouldUsePipelining;
mainDocumentURL = mainDocumentURL ??
(iosMainDocumentURL != null ? WebUri.uri(iosMainDocumentURL!) : null);
networkServiceType = networkServiceType ??
URLRequestNetworkServiceType.fromNativeValue(
iosNetworkServiceType?.toNativeValue());
timeoutInterval = timeoutInterval ?? iosTimeoutInterval;
}