smart_seat_selector 0.1.0
smart_seat_selector: ^0.1.0 copied to clipboard
A universal grid-based seat selection widget for Flutter supporting Cinemas, Buses, Flights, and Event halls with zoom and pan interaction.
0.1.0 #
First major feature release — bug fixes, UI/UX upgrades, and multi-seat-type support, all in one release.
Bug Fixes #
- Grid immutability:
SeatControllernow deep-copies the grid on construction. External mutations to the original list no longer silently corrupt controller state. - Grid validation: Constructor throws a descriptive
ArgumentErrorif the grid is empty, has jagged rows (unequal column counts), or contains invalid cell values. - Dispose pattern:
SeatController.dispose()is now properly overridden, callingsuper.dispose()and clearing internal state to prevent memory leaks. selectedSeatsis now unmodifiable: ReturnsSet.unmodifiable(...)so external code cannot mutate selection state directly.
New Features — Multi-seat type support #
SeatTypeenum: four built-in seat classes —economy,business,vip,wheelchair.SeatMetamodel: each grid cell now carries aSeatState, aSeatType, and an optionalidstring for backend round-tripping.TypedSeatGridtypedef:List<List<SeatMeta>>— the new recommended grid format.Seatfactory class: concise helpers —Seat.gap(),Seat.economy(),Seat.business(booked: true),Seat.vip(),Seat.wheelchair(),Seat.gridFromInts()for migrating legacy integer grids.SeatTypeConfig: per-type visual + pricing config —label,price,currencySymbol,availableColor,bookedColor,selectedColor,selectionBorderColor,shape,icon,iconOnly.- Four built-in presets:
SeatTypeConfig.defaultEconomy,.defaultBusiness,.defaultVip,.defaultWheelchair.
- Four built-in presets:
SeatShapeenum:roundedRect(default),circle(wheelchair),stadium(VIP pill).SeatLayoutConfig.typeConfigs: map ofSeatType → SeatTypeConfig, pre-populated with all four presets. Color/shape resolution is type-aware viagetColor(state, type),getSelectionBorderColor(type),getShape(type),getBorderRadius(type).SeatController.totalPricegetter: sums prices for all selected seats using thepricesmap passed to the constructor. Also exposestotalPriceFormatted.SeatController.fromInts()factory: drop-in migration path for legacyList<List<int>>grids — all seats default toSeatType.economy.- Programmatic control API:
selectSeats(),selectRow(),selectByType(),selectAll(),clearSelection(),selectedCount,isMaxReached.
New Features — Layout & headers #
- Row & column headers:
SeatLayoutConfiggainsshowRowLabelsandshowColLabelsflags. Renders A–Z row letters on the left and 1–N column numbers across the top, automatically skipping gap/aisle columns so numbering stays aligned. labelBuildercallback:SeatLayoutaccepts an optionallabelBuilder(row, col)for custom seat labels (numeric, backend IDs, etc.) instead of the default A1/B2 format.
New Features — Tooltip #
- Seat tooltip / info popup: long-pressing any seat shows a small overlay card with the seat label, type name, status (Available/Booked/Selected/Unavailable), and price — fully type-aware. Auto-dismisses after 2 seconds. Controlled via
SeatLayoutConfig.showTooltip.
UI & UX Upgrades #
- Selection animations:
SeatItembounces (scale animation) on selection/deselection and shows an ink ripple on tap. Toggle viaSeatLayoutConfig.enableAnimations. - Type-aware rendering: seats render with the correct color, border radius, and shape per type — rounded rect, circle (wheelchair), or stadium/pill (VIP). Supports icon-only and icon+label rendering.
SeatLegendwidget: auto-renders color swatches for each configured seat type (with icon and shape) plus Booked/Unavailable/Selected states — always stays in sync with yourSeatLayoutConfig. Supports horizontal and vertical layouts.SeatSummaryBarwidget: live sticky bottom bar showing selected seat count, seat labels, animated total price, and a confirm button. Updates automatically viaAnimatedBuilder.
Breaking changes #
SeatControllerconstructor now takes aTypedSeatGridinstead ofList<List<int>>. UseSeatController.fromInts()for the legacy signature.SeatLayoutConfig.getColor()now takes an optionalSeatTypesecond argument (defaults toSeatType.economy, so old calls still compile).
0.0.7 #
- Fixed grid mistake in README.md.
0.0.6 #
- Feature: Added support for
disabledseat state (Value3in grid). - Fix: Resolved an issue where
SeatControllerwould notify listeners twice during selection updates, causing double rebuilds. - Optimization: Replaced
ContainerwithAnimatedContainerinSeatItemfor smoother selection transitions. - Docs: Updated
README.mdwith clearer installation instructions and updated configuration table.
0.0.5 #
- Fixed dependencies mistake in README.md.
0.0.4 #
- Breaking Change: Renamed
SeatLayoutWidgettoSeatLayoutfor cleaner usage. - Added full API documentation for
SeatLayout,SeatController, andSeatLayoutConfig. - Updated example app with better comments and structure.
- Fixed static analysis scores (library names and formatting).
0.0.3 #
- Improved License section formatting in README.md.
0.0.2 #
- Fixed formatting issues in the README.md table.
0.0.1 #
- Initial release of Smart Seat Selector.
- Added support for Cinemas, Buses, and Events.
- Added Zoom, Pan, and Multi-select features.