PersonRequirements.fromJson constructor

PersonRequirements.fromJson(
  1. Object? json
)

Implementation

factory PersonRequirements.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return PersonRequirements(
    alternatives: map['alternatives'] == null
        ? null
        : (map['alternatives'] as List<Object?>)
            .map((el) => AccountRequirementsAlternative.fromJson(el))
            .toList(),
    currentlyDue: (map['currently_due'] as List<Object?>)
        .map((el) => (el as String))
        .toList(),
    errors: (map['errors'] as List<Object?>)
        .map((el) => AccountRequirementsError.fromJson(el))
        .toList(),
    eventuallyDue: (map['eventually_due'] as List<Object?>)
        .map((el) => (el as String))
        .toList(),
    pastDue: (map['past_due'] as List<Object?>)
        .map((el) => (el as String))
        .toList(),
    pendingVerification: (map['pending_verification'] as List<Object?>)
        .map((el) => (el as String))
        .toList(),
  );
}