Data.fromJson constructor

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

Implementation

Data.fromJson(Map<String, dynamic> json) {
  uid = json['uid'];
  referralCode = json['referralCode'] ?? '';
  isGlobalSalesPool = json['isGlobalSalesPool'];
  isFounder = json['isFounder'];
  isCorporate = json['isCorporate'];
  wallet = json['wallet'];
  hasConfirmedBooking = json['hasConfirmedBooking'];
  founderShares = json['founderShares'];
  parentId = json['parentId'];
  createdAt = json['createdAt'];
  updatedAt = json['updatedAt'];
  loggedInLocation = json['loggedInLocation'];
  prevReferralCode= List<String>.from(json['prevReferralCode'] ?? []);
  if (json['subscription'] != null) {
    currentSubscription = Subscriptions.fromJson(json['subscription']);
  }
  if (json['addons'] != null) {
    addons = (json['addons'] as List<dynamic>).map((d) => Subscriptions.fromJson(d)).toList();
  }
  user = json['user'] != null ? UserModel.fromJson(json['user']) : null;
  userConfig = json['userConfig'] != null ? UserConfig.fromJson(json['userConfig']) : null;
  totalAdultPassengerLimit = json['adultPassengerLimit'];
  totalUnusedAdultPassengerLimit = json['unusedAdultPassengerLimit'];
  totalNeoMilesPaymentPercentage = json['neoMilesPaymentPercentage'];
  totalNeoOneMonthlySubscription = json['neoOneMonthlySubscription'];
  maxExclusiveBookings = json['maxExclusiveBookings'];
  unusedExclusiveBookings = json['unusedExclusiveBookings'];
  adultPassengerLimit = json['adultPassengerLimit'];
}