Account.fromJson constructor

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

Implementation

factory Account.fromJson(Map<String, dynamic>? json) {
  return json != null
      ? Account._(
          profile: Profile.fromJson(
            json['profile'] != null
                ? Map<String, dynamic>.from(json['profile'])
                : null,
          ),
          email: json['email'],
          isEmailValid: json['isEmailValid'],
          isEmailVerified: json['isEmailVerified'],
          ageRange: json['ageRange'],
          birthyear: json['birthyear'],
          birthday: json['birthday'],
          birthdayType:
              BirthdayTypeExtension.toBirthdayType(json['birthdayType']),
          gender: GenderExtension.toGender(json['gender']),
          phoneNumber: json['phoneNumber'],
          ci: json['ci'],
          ciAuthenticatedAt: json['ciAuthenticatedAt'] != null
              ? DateTime.fromMillisecondsSinceEpoch(json['ciAuthenticatedAt'])
              : null,
          profileNeedsAgreement: json['profileNeedsAgreement'],
          emailNeedsAgreement: json['emailNeedsAgreement'],
          ageRangeNeedsAgreement: json['ageRangeNeedsAgreement'],
          birthyearNeedsAgreement: json['birthyearNeedsAgreement'],
          birthdayNeedsAgreement: json['birthdayNeedsAgreement'],
          genderNeedsAgreement: json['genderNeedsAgreement'],
          phoneNumberNeedsAgreement: json['phoneNumberNeedsAgreement'],
          ciNeedsAgreement: json['ciNeedsAgreement'],
        )
      : Account._();
}