TransitObject.fromJson constructor

TransitObject.fromJson(
  1. Map json_
)

Implementation

TransitObject.fromJson(core.Map json_)
    : this(
        activationStatus: json_.containsKey('activationStatus')
            ? ActivationStatus.fromJson(json_['activationStatus']
                as core.Map<core.String, core.dynamic>)
            : null,
        appLinkData: json_.containsKey('appLinkData')
            ? AppLinkData.fromJson(
                json_['appLinkData'] as core.Map<core.String, core.dynamic>)
            : null,
        barcode: json_.containsKey('barcode')
            ? Barcode.fromJson(
                json_['barcode'] as core.Map<core.String, core.dynamic>)
            : null,
        classId: json_.containsKey('classId')
            ? json_['classId'] as core.String
            : null,
        classReference: json_.containsKey('classReference')
            ? TransitClass.fromJson(json_['classReference']
                as core.Map<core.String, core.dynamic>)
            : null,
        concessionCategory: json_.containsKey('concessionCategory')
            ? json_['concessionCategory'] as core.String
            : null,
        customConcessionCategory:
            json_.containsKey('customConcessionCategory')
                ? LocalizedString.fromJson(json_['customConcessionCategory']
                    as core.Map<core.String, core.dynamic>)
                : null,
        customTicketStatus: json_.containsKey('customTicketStatus')
            ? LocalizedString.fromJson(json_['customTicketStatus']
                as core.Map<core.String, core.dynamic>)
            : null,
        deviceContext: json_.containsKey('deviceContext')
            ? DeviceContext.fromJson(
                json_['deviceContext'] as core.Map<core.String, core.dynamic>)
            : null,
        disableExpirationNotification:
            json_.containsKey('disableExpirationNotification')
                ? json_['disableExpirationNotification'] as core.bool
                : null,
        groupingInfo: json_.containsKey('groupingInfo')
            ? GroupingInfo.fromJson(
                json_['groupingInfo'] as core.Map<core.String, core.dynamic>)
            : null,
        hasLinkedDevice: json_.containsKey('hasLinkedDevice')
            ? json_['hasLinkedDevice'] as core.bool
            : null,
        hasUsers: json_.containsKey('hasUsers')
            ? json_['hasUsers'] as core.bool
            : null,
        heroImage: json_.containsKey('heroImage')
            ? Image.fromJson(
                json_['heroImage'] as core.Map<core.String, core.dynamic>)
            : null,
        hexBackgroundColor: json_.containsKey('hexBackgroundColor')
            ? json_['hexBackgroundColor'] as core.String
            : null,
        id: json_.containsKey('id') ? json_['id'] as core.String : null,
        imageModulesData: json_.containsKey('imageModulesData')
            ? (json_['imageModulesData'] as core.List)
                .map((value) => ImageModuleData.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        infoModuleData: json_.containsKey('infoModuleData')
            ? InfoModuleData.fromJson(json_['infoModuleData']
                as core.Map<core.String, core.dynamic>)
            : null,
        linksModuleData: json_.containsKey('linksModuleData')
            ? LinksModuleData.fromJson(json_['linksModuleData']
                as core.Map<core.String, core.dynamic>)
            : null,
        locations: json_.containsKey('locations')
            ? (json_['locations'] as core.List)
                .map((value) => LatLongPoint.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        messages: json_.containsKey('messages')
            ? (json_['messages'] as core.List)
                .map((value) => Message.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        passConstraints: json_.containsKey('passConstraints')
            ? PassConstraints.fromJson(json_['passConstraints']
                as core.Map<core.String, core.dynamic>)
            : null,
        passengerNames: json_.containsKey('passengerNames')
            ? json_['passengerNames'] as core.String
            : null,
        passengerType: json_.containsKey('passengerType')
            ? json_['passengerType'] as core.String
            : null,
        purchaseDetails: json_.containsKey('purchaseDetails')
            ? PurchaseDetails.fromJson(json_['purchaseDetails']
                as core.Map<core.String, core.dynamic>)
            : null,
        rotatingBarcode: json_.containsKey('rotatingBarcode')
            ? RotatingBarcode.fromJson(json_['rotatingBarcode']
                as core.Map<core.String, core.dynamic>)
            : null,
        smartTapRedemptionValue: json_.containsKey('smartTapRedemptionValue')
            ? json_['smartTapRedemptionValue'] as core.String
            : null,
        state:
            json_.containsKey('state') ? json_['state'] as core.String : null,
        textModulesData: json_.containsKey('textModulesData')
            ? (json_['textModulesData'] as core.List)
                .map((value) => TextModuleData.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        ticketLeg: json_.containsKey('ticketLeg')
            ? TicketLeg.fromJson(
                json_['ticketLeg'] as core.Map<core.String, core.dynamic>)
            : null,
        ticketLegs: json_.containsKey('ticketLegs')
            ? (json_['ticketLegs'] as core.List)
                .map((value) => TicketLeg.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        ticketNumber: json_.containsKey('ticketNumber')
            ? json_['ticketNumber'] as core.String
            : null,
        ticketRestrictions: json_.containsKey('ticketRestrictions')
            ? TicketRestrictions.fromJson(json_['ticketRestrictions']
                as core.Map<core.String, core.dynamic>)
            : null,
        ticketStatus: json_.containsKey('ticketStatus')
            ? json_['ticketStatus'] as core.String
            : null,
        tripId: json_.containsKey('tripId')
            ? json_['tripId'] as core.String
            : null,
        tripType: json_.containsKey('tripType')
            ? json_['tripType'] as core.String
            : null,
        validTimeInterval: json_.containsKey('validTimeInterval')
            ? TimeInterval.fromJson(json_['validTimeInterval']
                as core.Map<core.String, core.dynamic>)
            : null,
        version: json_.containsKey('version')
            ? json_['version'] as core.String
            : null,
      );