fromMap static method

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

Gets a possible PermissionRequest instance from a Map value.

Implementation

static PermissionRequest? fromMap(Map<String, dynamic>? map) {
  if (map == null) {
    return null;
  }
  final instance = PermissionRequest(
    frame: FrameInfo.fromMap(map['frame']?.cast<String, dynamic>()),
    origin: WebUri(map['origin']),
  );
  instance.resources = List<PermissionResourceType>.from(map['resources']
      .map((e) => PermissionResourceType.fromNativeValue(e)!));
  return instance;
}