SignedExchangeInfo.fromJson constructor

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

Implementation

factory SignedExchangeInfo.fromJson(Map<String, dynamic> json) {
  return SignedExchangeInfo(
    outerResponse:
        ResponseData.fromJson(json['outerResponse'] as Map<String, dynamic>),
    header: json.containsKey('header')
        ? SignedExchangeHeader.fromJson(
            json['header'] as Map<String, dynamic>)
        : null,
    securityDetails: json.containsKey('securityDetails')
        ? SecurityDetails.fromJson(
            json['securityDetails'] as Map<String, dynamic>)
        : null,
    errors: json.containsKey('errors')
        ? (json['errors'] as List)
            .map((e) =>
                SignedExchangeError.fromJson(e as Map<String, dynamic>))
            .toList()
        : null,
  );
}