WebCallOptions constructor

WebCallOptions({
  1. Map<String, String>? metadata,
  2. Duration? timeout,
  3. List<MetadataProvider>? providers,
  4. bool? bypassCorsPreflight,
  5. bool? withCredentials,
})

Creates a WebCallOptions object.

WebCallOptions can specify static metadata, timeout, metadata providers of CallOptions, bypassCorsPreflight and withCredentials for CORS request.

Implementation

factory WebCallOptions({
  Map<String, String>? metadata,
  Duration? timeout,
  List<MetadataProvider>? providers,
  bool? bypassCorsPreflight,
  bool? withCredentials,
}) {
  return WebCallOptions._(
    Map.unmodifiable(metadata ?? {}),
    timeout,
    List.unmodifiable(providers ?? []),
    bypassCorsPreflight: bypassCorsPreflight ?? false,
    withCredentials: withCredentials ?? false,
  );
}