seat_kit 0.2.0
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.
example/lib/main.dart
/// seat_kit example app.
///
/// Demonstrates the full public API of `package:seat_kit/seat_kit.dart`:
///
/// * Four built-in template generators ([theaterGrid], [busLayout],
/// [restaurantTables], [gaSection]).
/// * Custom-JSON loading via [SeatMap.fromJson] (assets/maps/balcony.json).
/// * Interactive rendering with [SeatMapView] (pan, pinch-zoom, tap-to-select).
/// * Live selection feedback via [SeatMapView.onSelectionChanged].
/// * Rejection feedback (snackbars) via [SeatMapView.onTapResult].
/// * Status legend showing every [SeatStatus] color.
/// * "Clear selection" via [seatSelectionControllerProvider].
///
/// This file only imports [package:seat_kit/seat_kit.dart] (the public barrel)
/// and [package:flutter_riverpod/flutter_riverpod.dart] — no src/ imports.
library;
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'demo_page.dart';
void main() {
runApp(const SeatKitExampleApp());
}
class SeatKitExampleApp extends StatelessWidget {
const SeatKitExampleApp({super.key});
@override
Widget build(BuildContext context) {
return ProviderScope(
// ProviderScope is required by flutter_riverpod and must wrap every
// widget that uses `ref` (including SeatMapView itself).
child: MaterialApp(
title: 'seat_kit demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF1565C0)),
useMaterial3: true,
),
home: const DemoPage(),
),
);
}
}