seat_kit library
Models, rendering, and selection tooling for interactive seat maps.
Classes
- GaZoneSpec
- Describes one general-admission zone in a gaSection layout.
- SeatCategory
- A named grouping for seats (e.g. "VIP", "Balcony").
- SeatDecoration
- A non-selectable visual element placed on a seat map, such as a stage, screen, or entrance marker.
-
SeatElement<
T> - A single selectable seat on a seat map.
- SeatFilter
- Kit-ignorant filter that dims and disables non-matching seats.
- SeatFilterBar
-
A wrapping row of card-style filter buttons that emits a
bool Function(SeatElement<dynamic>)?predicate whenever the user toggles a card. -
SeatMap<
T> - The top-level description of a venue's seat layout.
- SeatMapPainter
-
Paints every SeatElement and SeatDecoration of a SeatMap onto a
single canvas using rounded rectangles sized by each seat's
SeatElement.width/SeatElement.height. - SeatMapTheme
- Visual configuration for SeatMapView.
-
SeatMapView<
T> - Renders a SeatMap at a fit-to-screen fixed scale with tap-to-select.
- SeatPosition
- A coordinate in the abstract 2D space of a seat map canvas.
- SeatSelectionController
- Owns the set of locally selected seat ids for a given seat map and enforces its selection rules on every mutation.
- SeatSelectionControllerFamily
- Owns the set of locally selected seat ids for a given seat map and enforces its selection rules on every mutation.
- SeatSelectionControllerProvider
- Owns the set of locally selected seat ids for a given seat map and enforces its selection rules on every mutation.
- SelectionDecision
-
The result of an app-supplied
canSelectpredicate. - SelectionResult
- The outcome of a selection mutation attempt.
- SelectionRules
- Constraints that govern how seats may be selected on a seat map.
- TableSpec
- Describes a single table in a restaurantTables layout.
Enums
- DecorationKind
- The kind of non-selectable visual a SeatDecoration represents.
- SeatStatus
- The lifecycle state of a selectable seat element.
- SeatStyle
- How SeatStatus.available seats are painted on the seat map.
- SelectionRejectionReason
- The reason a selection mutation attempt was rejected.
- TableShape
- The shape used to position seats around a table.
Extensions
- SeatCategoryPatterns on SeatCategory
- Adds pattern-matching-related methods to SeatCategory.
- SeatDecorationPatterns on SeatDecoration
- Adds pattern-matching-related methods to SeatDecoration.
-
SeatElementPatterns
on SeatElement<
T> - Adds pattern-matching-related methods to SeatElement.
-
SeatMapPatterns
on SeatMap<
T> - Adds pattern-matching-related methods to SeatMap.
- SeatPositionPatterns on SeatPosition
- Adds pattern-matching-related methods to SeatPosition.
- SelectionDecisionPatterns on SelectionDecision
- Adds pattern-matching-related methods to SelectionDecision.
- SelectionResultPatterns on SelectionResult
- Adds pattern-matching-related methods to SelectionResult.
- SelectionRulesPatterns on SelectionRules
- Adds pattern-matching-related methods to SelectionRules.
Constants
- kCategoryDoubleLower → const SeatCategory
- Lower double berth — right side of the aisle (wider, fits two).
- kCategoryDoubleUpper → const SeatCategory
- Upper double berth — above double lower berths.
- kCategorySeater → const SeatCategory
- Regular seater seat — front section of the bus.
- kCategorySingleLower → const SeatCategory
- Lower single berth — window side, left of the aisle.
- kCategorySingleUpper → const SeatCategory
- Upper single berth — above single lower berths.
- kSleeper44CategoryDL → const SeatCategory
- Double Lower berth — full-height berths beneath the seaters in the middle column group of the sleeper44 reference layout.
-
kSleeper44DefaultPrices
→ const Map<
String, String> -
Default display prices per category id, used when sleeper44Layout's
priceForargument doesn't supply one. The kit never interprets these values beyond storing them onSeatCategory.displayPrice. - kSleeper48CategoryDU → const SeatCategory
- Double Upper berth — rightmost two columns.
- kSleeper48CategorySeater → const SeatCategory
- Half-height seater — center two columns (stacked two per row slot).
- kSleeper48CategorySL → const SeatCategory
- Single Lower berth — second column from left.
- kSleeper48CategorySU → const SeatCategory
- Single Upper berth — leftmost column of the sleeper48 reference layout.
- kSleeper60CategoryCL → const SeatCategory
- Full-height berths beneath the C-seaters, left of the central aisle.
- kSleeper60CategoryCU → const SeatCategory
- Far-left full-height berth column of the sleeper60 reference layout.
- kSleeper60CategoryDL → const SeatCategory
- Full-height berths beneath the D-seaters, right of the central aisle.
-
kSleeper60DefaultPrices
→ const Map<
String, String> -
Default display prices per category id, used when sleeper60Layout's
priceForargument doesn't supply one. The kit never interprets these values beyond storing them onSeatCategory.displayPrice. The C and D seater groups share the'seater'category id and price.
Properties
- seatSelectionControllerProvider → SeatSelectionControllerFamily
-
Owns the set of locally selected seat ids for a given seat map and
enforces its selection rules on every mutation.
final
Functions
-
busLayout<
T> ({int berthRows = 7, int seaterRows = 3, double berthWidth = 38, double berthHeight = 68, double seaterWidth = 38, double seaterHeight = 34, double berthSpacingY = 76, double seaterSpacingY = 44, double singleBerthGapX = 6, double doubleBerthGapX = 6, double aisleWidth = 28, double seaterSpacingX = 44, double leftMargin = 40, double topMargin = 8, String id = 'bus', String name = 'Sleeper Bus', T? dataBuilder(String seatId, String seatType)?, SelectionRules selectionRules = const SelectionRules()}) → SeatMap< T> - Generates an Indian-style sleeper coach seat map.
-
gaSection<
T> ({required List< GaZoneSpec> zones, String id = 'ga', String name = 'General Admission', bool addStage = true, T? dataBuilder(String seatId)?, SelectionRules selectionRules = const SelectionRules()}) → SeatMap<T> - Generates a general-admission seat map: one selectable SeatElement per zone, plus a matching zone-block SeatDecoration and an optional stage/screen decoration at the front.
-
restaurantTables<
T> ({required List< TableSpec> tables, String id = 'restaurant', String name = 'Restaurant', SeatPosition? entrancePosition, T? dataBuilder(String seatId)?, SelectionRules selectionRules = const SelectionRules()}) → SeatMap<T> - Generates a restaurant-style seat map: scattered tables with seats placed around them, plus an entrance decoration.
-
sleeper44Layout<
T> ({double berthWidth = 38, double berthHeight = 68, double seaterWidth = 38, double seaterHeight = 34, double berthSpacingY = 76, double intraGroupGap = 4, double centralAisleWidth = 44, double interGroupGap = 32, double leftMargin = 40, double topMargin = 16, String id = 'sleeper44', String name = 'Sleeper 44', Map< String, String> ? priceFor, T? dataBuilder(String seatId, String seatType)?, SelectionRules selectionRules = const SelectionRules()}) → SeatMap<T> - Generates a 44-seat Indian sleeper coach seat map.
-
sleeper48Layout<
T> ({double berthWidth = 38, double berthHeight = 68, double seaterWidth = 38, double seaterHeight = 34, double berthSpacingY = 76, double intraGroupGap = 4, double centralAisleWidth = 44, double interGroupGap = 32, double leftMargin = 40, double topMargin = 16, String id = 'sleeper48', String name = 'Sleeper 48', T? dataBuilder(String seatId, String seatType)?, SelectionRules selectionRules = const SelectionRules()}) → SeatMap< T> - Generates the reference 48-seat Indian sleeper coach seat map.
-
sleeper60Layout<
T> ({double berthWidth = 38, double berthHeight = 68, double seaterWidth = 38, double seaterHeight = 34, double berthSpacingY = 76, double intraGroupGap = 4, double centralAisleWidth = 44, double interGroupGap = 32, double leftMargin = 40, double topMargin = 16, String id = 'sleeper60', String name = 'Sleeper 60', Map< String, String> ? priceFor, T? dataBuilder(String seatId, String seatType)?, SelectionRules selectionRules = const SelectionRules()}) → SeatMap<T> - Generates a 60-seat Indian sleeper coach seat map.
-
theaterGrid<
T> ({required int rows, required int cols, String id = 'theater', String name = 'Theatre', List< int> aisleAfterColumns = const [], bool markAisles = true, bool curvedRows = false, double seatSpacingX = 40, double seatSpacingY = 44, double aisleWidth = 20, double curveDepth = 18, double topMargin = 90, double leftMargin = 40, T? dataBuilder(String seatId, int rowIndex, int colNumber)?, Map<int, SeatCategory> ? rowCategories, SelectionRules selectionRules = const SelectionRules()}) → SeatMap<T> - Generates a theatre-style seat map: a rectangular grid of rows and columns with a stage/screen decoration at the front (top, y = 0).
-
zoneLabelFor(
GaZoneSpec zone) → String - Returns the label string that gaSection places on a zone element.
Typedefs
-
CanSelectPredicate
= SelectionDecision Function(SeatElement seat, SeatMap seatMap, Set<
String> selectedIds) - App-supplied business-rule hook evaluated for a seat the user is trying to select.
- SelectionRejection = SelectionRejected
- A rejected SelectionResult, carrying the SelectionRejectionReason and an optional app-supplied message.