fromMap static method

FetchRequest? fromMap(
  1. Map<String, dynamic>? map
)

Gets a possible FetchRequest instance from a Map value.

Implementation

static FetchRequest? fromMap(Map<String, dynamic>? map) {
  if (map == null) {
    return null;
  }
  final instance = FetchRequest(
    body: map['body'],
    cache: map['cache'],
    credentials: _fetchRequestCredentialDeserializer(map['credentials']),
    headers: map['headers']?.cast<String, dynamic>(),
    integrity: map['integrity'],
    keepalive: map['keepalive'],
    method: map['method'],
    mode: map['mode'],
    redirect: map['redirect'],
    referrer: map['referrer'],
    referrerPolicy: ReferrerPolicy.fromNativeValue(map['referrerPolicy']),
    url: map['url'] != null ? WebUri(map['url']) : null,
  );
  instance.action = FetchRequestAction.fromNativeValue(map['action']);
  return instance;
}