TerminalLocation.fromJson constructor

TerminalLocation.fromJson(
  1. Object? json
)

Implementation

factory TerminalLocation.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return TerminalLocation(
    address: Address.fromJson(map['address']),
    configurationOverrides: map['configuration_overrides'] == null
        ? null
        : (map['configuration_overrides'] as String),
    displayName: (map['display_name'] as String),
    id: (map['id'] as String),
    livemode: (map['livemode'] as bool),
    metadata: (map['metadata'] as Map).cast<String, Object?>().map((
          key,
          value,
        ) =>
            MapEntry(
              key,
              (value as String),
            )),
  );
}