SharedStorageAccessParams.fromJson constructor

SharedStorageAccessParams.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory SharedStorageAccessParams.fromJson(Map<String, dynamic> json) {
  return SharedStorageAccessParams(
    scriptSourceUrl: json.containsKey('scriptSourceUrl')
        ? json['scriptSourceUrl'] as String
        : null,
    operationName: json.containsKey('operationName')
        ? json['operationName'] as String
        : null,
    serializedData: json.containsKey('serializedData')
        ? json['serializedData'] as String
        : null,
    urlsWithMetadata: json.containsKey('urlsWithMetadata')
        ? (json['urlsWithMetadata'] as List)
            .map((e) => SharedStorageUrlWithMetadata.fromJson(
                e as Map<String, dynamic>))
            .toList()
        : null,
    key: json.containsKey('key') ? json['key'] as String : null,
    value: json.containsKey('value') ? json['value'] as String : null,
    ignoreIfPresent: json.containsKey('ignoreIfPresent')
        ? json['ignoreIfPresent'] as bool
        : null,
  );
}