flightsGetSeatMap method

Future<SeatMap?> flightsGetSeatMap(
  1. String publicId, {
  2. Future<void>? abortTrigger,
})

Get a flight seat map

Returns the seat map of a flight offer, with the seats each passenger can take and their prices. The seat map is read from the airline on each call, so availability can change between calls; prices are in the API key's currency. isSupported is false when the airline offers no seat selection for the offer. Segments are named by sliceIndex and segmentIndex, their 1-based position in the offer; a segment without a seat map is left out. A seat can be booked only for the passengers in its availableFor. Send chosen seats in the order's inputs.passengers[].selectedSeats, one per passenger per segment. An unknown, expired or another partner's publicId returns 400 / 11004.

Parameters:

  • String publicId (required): An offer or fare option publicId from search or quote.

Implementation

Future<SeatMap?> flightsGetSeatMap(String publicId, { Future<void>? abortTrigger, }) async {
  final response = await flightsGetSeatMapWithHttpInfo(publicId, abortTrigger: abortTrigger,);
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SeatMap',) as SeatMap;

  }
  return null;
}