Skip to content

seatlayer/seatlayer-flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SeatLayer for Flutter

pub package Flutter Dart License: MIT

The official Flutter SDK for embedding interactive SeatLayer reserved-seating maps on iOS and Android. It includes selection, holds, best available, general admission, floors, accessibility controls, and a typed event bridge.

Package on pub.dev · Developer docs · Live demo · Website · Native Android · React Native · AI Toolkit

Public preview: 0.1.x is the first public Flutter line. Validate it with a test event and physical iOS/Android devices before production rollout.

Install

flutter pub add seatlayer

Or add it to pubspec.yaml:

dependencies:
  seatlayer: ^0.1.0

Then import the public library:

import 'package:seatlayer/seatlayer.dart';

Quick start

Create one controller for the lifetime of the view. Give the map a definite height or place it full-screen.

final controller = SeatLayerController();

@override
Widget build(BuildContext context) {
  return SizedBox(
    height: 640,
    child: SeatLayerView(
      controller: controller,
      configuration: SeatLayerConfiguration(
        event: 'ev_your_event_key',
        currency: 'USD',
      ),
      onReady: (info) {
        debugPrint(
          'SeatLayer ready: protocol=${info.protocolRevision} '
          'mode=${info.mode.raw}',
        );
      },
    ),
  );
}

@override
void dispose() {
  controller.dispose();
  super.dispose();
}

Drive buyer actions through the controller:

try {
  final hold = await controller.bestAvailable(4);
  if (hold != null) {
    beginCheckoutOnYourServer(hold.holdId);
  }
} on SeatLayerError catch (error) {
  // Handle sold_out, not_enough_together, expired holds, and other
  // recoverable inventory outcomes in the buyer UI.
  showSeatError(error.code, error.message);
}

Subscribe to strongly typed event streams:

controller.onSelectionChanged.listen(updateSelectedSeats);
controller.onHold.listen(persistHold);
controller.onHoldExpired.listen(returnBuyerToMap);
controller.onError.listen(reportSeatLayerError);

Security boundary

The Flutter app selects and holds inventory. Your trusted backend inspects and books the hold after payment or order validation.

  • Never ship a SeatLayer secret key in the app binary or WebView.
  • Send only the holdId and your normal checkout context to your backend.
  • Calculate the charge from server-inspected hold items, not app input.
  • Reuse your stable order id as bookingRef for safe booking retries.

Read how the integration works before connecting checkout.

How it works

The SDK hosts a vendored seatlayer-js@0.26.0 buyer bundle inside webview_flutter and communicates over SeatLayer's versioned bridge protocol. The UI can start without downloading SDK JavaScript; live chart and inventory data still come from the configured SeatLayer API.

The public contract matches the Web and iOS SDKs:

  • commands return Future values and throw typed SeatLayerError failures;
  • events arrive through typed Dart streams;
  • protocol negotiation fails clearly when an app update is required; and
  • unknown future enum values and events remain forward-compatible.

Commands

hold · resumeHold · extendHold · release · releaseLabels · bestAvailable · holdGA · setSeatTier · getSelection · getCurrentHold · getGAAreas · getFloors · setFloor · setColorblindSafe · zoomIn · zoomOut · zoomToFit · destroy

Event streams

onReady · onSelectionChanged · onHold · onHoldRestored · onHoldExpired · onError · onHint · onGAClick · onSeatHover · onDeckTap · onUnknownEvent

Layout requirement

Do not place the seat map inside ListView, SingleChildScrollView, or another gesture-driven scrolling surface. The canvas owns pan and pinch gestures for map navigation. Use a fixed-height SizedBox, an Expanded child with a resolved height, or a full-screen route.

Run the example

cd example
flutter run

The example uses the SDK's offline fixture to exercise the real bridge and renderer without a live event key. For an end-to-end integration, provide a test event and keep the default API origin.

Related resources

Development

flutter pub get
flutter analyze
flutter test
dart pub publish --dry-run

License

MIT © SeatLayer

About

Official SeatLayer Flutter SDK — interactive seat maps, browser holds, typed Dart bridge, and vendored buyer bundle for iOS and Android.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages