fromMap static method

PassportElementsWithErrors? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static PassportElementsWithErrors? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var elements = List<PassportElement>.from(
    (_map["elements"] ?? []).map(
      (e) => PassportElement.fromMap(e),
    ),
  );
  var errors = List<PassportElementError>.from(
    (_map["errors"] ?? []).map(
      (e) => PassportElementError.fromMap(e),
    ),
  );
  return PassportElementsWithErrors(
    extra: extra,
    clientId: clientId,
    elements: elements,
    errors: errors,
  );
}