URLRequest constructor

URLRequest({
  1. bool? allowsCellularAccess,
  2. bool? allowsConstrainedNetworkAccess,
  3. bool? allowsExpensiveNetworkAccess,
  4. bool? assumesHTTP3Capable,
  5. URLRequestAttribution? attribution,
  6. Uint8List? body,
  7. URLRequestCachePolicy? cachePolicy,
  8. Map<String, String>? headers,
  9. bool? httpShouldHandleCookies,
  10. bool? httpShouldUsePipelining,
  11. @Deprecated('Use allowsCellularAccess instead') bool? iosAllowsCellularAccess,
  12. @Deprecated('Use allowsConstrainedNetworkAccess instead') bool? iosAllowsConstrainedNetworkAccess,
  13. @Deprecated('Use allowsExpensiveNetworkAccess instead') bool? iosAllowsExpensiveNetworkAccess,
  14. @Deprecated('Use cachePolicy instead') IOSURLRequestCachePolicy? iosCachePolicy,
  15. @Deprecated('Use httpShouldHandleCookies instead') bool? iosHttpShouldHandleCookies,
  16. @Deprecated('Use httpShouldUsePipelining instead') bool? iosHttpShouldUsePipelining,
  17. @Deprecated('Use mainDocumentURL instead') Uri? iosMainDocumentURL,
  18. @Deprecated('Use networkServiceType instead') IOSURLRequestNetworkServiceType? iosNetworkServiceType,
  19. @Deprecated('Use timeoutInterval instead') double? iosTimeoutInterval,
  20. WebUri? mainDocumentURL,
  21. String? method,
  22. URLRequestNetworkServiceType? networkServiceType,
  23. double? timeoutInterval,
  24. 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;
}