seat_kit 0.2.0 copy "seat_kit: ^0.2.0" to clipboard
seat_kit: ^0.2.0 copied to clipboard

A Flutter toolkit for modeling, rendering, and selecting seats on interactive seat maps for events and venues.

0.2.0 #

New bus layouts and dynamic, per-category seat filtering — no breaking changes.

  • sleeper44Layout — a 44-seat sleeper coach: single upper/lower berth columns (SU/SL), stacked seaters in the middle group, full-height DL (Double Lower) berths beneath them, and DU (Double Upper) berths on the right.
  • sleeper60Layout — a 60-seat sleeper coach with four sub-columns either side of the aisle: CU berths, C-seaters over CL berths, D-seaters over DL berths, and DU berths, with mirrored numbering across the aisle and three independent price tiers.
  • Both new layouts are registered in the example app's layout registry — the Bus dropdown now lists all three (48/44/60-seater) sleeper layouts.
  • Dynamic filter chips — SeatFilterBar's category chips are now derived from the distinct SeatCategorys actually present in the loaded SeatMap, instead of a fixed list, so they automatically match whichever layout is selected. Each distinct category (including SU, SL, seater, DU, DL, CU, CL) gets its own chip with its own label — Upper and Lower berth categories are never grouped together.
  • Additive filter semantics — category chips now start OFF; activating one or more chips shows only the matching seat type(s) (union of active chips) and dims the rest. With nothing active, every seat is visible. "Available only" and custom predicates combine with the type filter using AND.
  • Fixed the example's "Lower berths only" predicate to match only true lower berths (SL, DL, CL) — it previously also matched DU (Double Upper) berths.

0.1.0 #

First publish-ready release. Builds on the previous unpublished snapshots with a generic payload, a flagship bus reference layout, seat styles, and full public API documentation.

  • Generic <T> payload — SeatMap<T> and SeatElement<T> carry an opaque, kit-ignorant developer payload data: T?, returned as-is through SeatMapView.onSelectionChanged. SeatMap<T>.fromJson/toJson are hand-written (not json_serializable-generated) to work around a json_serializable 6.13.x crash on generic list fields — see the README "Notes for maintainers" section.
  • sleeper48Layout — the flagship shipping reference layout: a 48-seat Indian sleeper coach (SU/SL/seater/DU columns), right-hand-drive driver cabin, chassis outline, and an entry door drawn inside the bus body. This is the layout the example showcase wires up end-to-end and the one to copy when building a real bus booking screen.
  • SeatStyle.filled / SeatStyle.outlined — SeatMapView.seatStyle controls how available seats render: solid color fill (default) or a white/transparent fill with a colored border and label. Booked, unavailable, tagged, and selected seats always render filled in either style.
  • Tags — SeatElement.tag is a free-form, opaque string for app-defined seat markers (e.g. 'ladies', 'accessible'), rendered via SeatMapView.tagColors / tagLabels. The kit never interprets tag values.
  • Filtering — an opt-in bool Function(SeatElement<T>)? predicate (SeatMapView.filter) dims and excludes non-matching seats from hit-testing. SeatFilterBar is a ready-made category/availability toggle row that emits this predicate shape.
  • canSelect / messageBuilder — app-owned hooks for business rules (e.g. adjacency restrictions) and rejection text. The kit ships zero hardcoded rejection strings and has no concept of gender, identity, or "ladies seat" rules; see the README for the full design rationale.
  • Five layout generators total: sleeper48Layout (flagship, fully wired up in the example showcase) plus four foundational/basic generators — theaterGrid, busLayout, restaurantTables, gaSection — covering the common grid, table, and zone shapes for other venue types.
  • Full dartdoc coverage for every exported type, method, and parameter (public_member_api_docs lint enabled).

0.0.1+1 #

  • Added SeatMapView.onTapResult callback — fires with SelectionResult on every seat tap (success and rejection) so host apps can show feedback without direct controller access.
  • Added four layout generators: theaterGrid, busLayout, restaurantTables, gaSection. Exported from seat_kit.dart.
  • Added GaZoneSpec, TableSpec, TableShape, zoneLabelFor supporting types.
  • Added runnable example app in example/ demonstrating all templates, live selection panel, rejection snackbars, status legend, and custom-JSON loading.
  • Updated README with real install + usage snippets.

0.0.1 #

  • Initial release: Freezed data models for seat maps (SeatMap, SeatElement, SeatDecoration, SeatCategory, SeatPosition, SeatStatus, SelectionRules) with JSON serialization.
  • Added SeatSelectionController, a Riverpod (@riverpod) notifier that owns local seat selection for a SeatMap and enforces its SelectionRules (availability, maxSelectable, row-adjacency) on every mutation, returning a typed SelectionResult (SelectionSuccess / SelectionRejected with a SelectionRejectionReason) instead of throwing. No booking, API calls, or hold timers — selection state only.
  • Added SeatMapView, a single canvas-based widget that renders a SeatMap with pan/pinch/scroll zoom (InteractiveViewer), fit-to-screen on first layout, accessible status visuals (color + glyph), and tap-to-select wired to SeatSelectionController. Built on a single CustomPainter (SeatMapPainter, internal) with manual hit-testing so it scales to thousands of seats without per-seat widgets. SeatMapTheme exposes styling. onSelectionChanged reports the selection as plain SeatElements — the kit still owns no booking, pricing, or networking.
1
likes
160
points
8
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter toolkit for modeling, rendering, and selecting seats on interactive seat maps for events and venues.

Repository (GitHub)
View/report issues

Topics

#seat-map #booking #widget #canvas #riverpod

License

MIT (license)

Dependencies

flutter, flutter_riverpod, freezed_annotation, json_annotation, riverpod_annotation

More

Packages that depend on seat_kit