CivicinfoApiprotosV2VoterInfoResponse.fromJson constructor

CivicinfoApiprotosV2VoterInfoResponse.fromJson(
  1. Map json_
)

Implementation

CivicinfoApiprotosV2VoterInfoResponse.fromJson(core.Map json_)
  : this(
      contests: (json_['contests'] as core.List?)
          ?.map(
            (value) => CivicinfoSchemaV2Contest.fromJson(
              value as core.Map<core.String, core.dynamic>,
            ),
          )
          .toList(),
      dropOffLocations: (json_['dropOffLocations'] as core.List?)
          ?.map(
            (value) => CivicinfoSchemaV2PollingLocation.fromJson(
              value as core.Map<core.String, core.dynamic>,
            ),
          )
          .toList(),
      earlyVoteSites: (json_['earlyVoteSites'] as core.List?)
          ?.map(
            (value) => CivicinfoSchemaV2PollingLocation.fromJson(
              value as core.Map<core.String, core.dynamic>,
            ),
          )
          .toList(),
      election: json_.containsKey('election')
          ? CivicinfoSchemaV2Election.fromJson(
              json_['election'] as core.Map<core.String, core.dynamic>,
            )
          : null,
      kind: json_['kind'] as core.String?,
      mailOnly: json_['mailOnly'] as core.bool?,
      normalizedInput: json_.containsKey('normalizedInput')
          ? CivicinfoSchemaV2SimpleAddressType.fromJson(
              json_['normalizedInput'] as core.Map<core.String, core.dynamic>,
            )
          : null,
      otherElections: (json_['otherElections'] as core.List?)
          ?.map(
            (value) => CivicinfoSchemaV2Election.fromJson(
              value as core.Map<core.String, core.dynamic>,
            ),
          )
          .toList(),
      pollingLocations: (json_['pollingLocations'] as core.List?)
          ?.map(
            (value) => CivicinfoSchemaV2PollingLocation.fromJson(
              value as core.Map<core.String, core.dynamic>,
            ),
          )
          .toList(),
      precinctId: json_['precinctId'] as core.String?,
      precincts: (json_['precincts'] as core.List?)
          ?.map(
            (value) => CivicinfoSchemaV2Precinct.fromJson(
              value as core.Map<core.String, core.dynamic>,
            ),
          )
          .toList(),
      state: (json_['state'] as core.List?)
          ?.map(
            (value) => CivicinfoSchemaV2AdministrationRegion.fromJson(
              value as core.Map<core.String, core.dynamic>,
            ),
          )
          .toList(),
    );