SeatController.fromInts constructor

SeatController.fromInts({
  1. required List<List<int>> seatGrid,
  2. int maxSelection = 5,
  3. Map<SeatType, double> prices = const {},
  4. List<SeatPoint> initialSelection = const [],
})

Convenience factory that wraps a legacy integer grid.

Integer encoding: 0 = gap, 1 = available, 2 = booked, 3 = disabled. All seats default to SeatType.economy.

Implementation

factory SeatController.fromInts({
  required List<List<int>> seatGrid,
  int maxSelection = 5,
  Map<SeatType, double> prices = const {},
  List<SeatPoint> initialSelection = const [],
}) {
  _validateIntGrid(seatGrid);
  return SeatController(
    seatGrid: Seat.gridFromInts(seatGrid),
    maxSelection: maxSelection,
    prices: prices,
    initialSelection: initialSelection,
  );
}