PasskitPass.fromJson constructor
PasskitPass.fromJson(
- Map<String, dynamic> json
)
Implementation
factory PasskitPass.fromJson(Map<String, dynamic> json) {
return PasskitPass(
formatVersion: json['formatVersion'] as int,
passTypeIdentifier: json['passTypeIdentifier'],
description: json['description'],
teamIdentifier: json['teamIdentifier'],
organizationName: json['organizationName'],
serialNumber: json['serialNumber'],
logoText: json['logoText'],
groupingIdentifier: json['groupingIdentifier'],
storeCard: _structure('storeCard', json),
eventTicket: _structure('eventTicket', json),
boardingPass: _structure('boardingPass', json),
generic: _structure('generic', json),
coupon: _structure('coupon', json),
labelColor: color(color: json['labelColor']),
backgroundColor: color(color: json['backgroundColor']),
foregroundColor: color(color: json['foregroundColor']),
webServiceURL: json['webServiceURL'],
authenticationToken: json['authenticationToken'],
appLaunchURL: json['appLaunchURL'],
associatedStoreIdentifiers:
(json['associatedStoreIdentifiers'] as List<dynamic>?)
?.map((e) => e as int)
.toList(),
expirationDate: json['expirationDate'],
voided: json['voided'] as bool?,
sharingProhibited: json['sharingProhibited'] as bool?,
relevantDate: json['relevantDate'],
maxDistance: json['maxDistance'] as int?,
locations: (json['locations'] as List<dynamic>?)
?.map((e) => PasskitLocation.fromJson(e as Map<String, dynamic>))
.toList(),
barcodes: (json['barcodes'] as List<dynamic>?)
?.map((e) => PasskitBarcode.fromJson(e as Map<String, dynamic>))
.toList(),
nfc: json['nfc'] != null ? PasskitNfc.fromJson(json['nfc']) : null,
);
}