TicketKO Widgets
Flutter package for integrating TicketKO widgets into Flutter apps.
Features
This package provides four types of TicketKO widgets for different event ticketing scenarios:
- AuditoriumlessEventTicketsWidget - For events without specific seating arrangements
- AuditoriumEventTicketsWidget - For events with auditorium seating and seat selection
- TicketKOTimePeriodEventsWidget - For events that occur over a specific time period
- StandaloneTicketsAndVouchersWidget - For standalone tickets and vouchers
- CatalogueWidget - For displaying event catalogues
All widgets support:
- Production and test environments
- Multi-language support
- Event callbacks for ticket order updates
- Responsive web-based interface through WebView
Getting started
Prerequisites
- Flutter SDK
- Dart 3.5.0 or higher
Usage
Basic Implementation
Import the package:
import 'package:ticketko_widgets/ticketko_widgets.dart';
Auditoriumless Event Tickets
AuditoriumlessEventTicketsWidget(
widgetId: "your-widget-id",
language: "en",
environment: TicketKOEnvironment.test, // or TicketKOEnvironment.production
onTicketOrderUpdated: (data) {
// Handle ticket order updates
print('Order updated: ${data['id']}');
},
)
Auditorium Event Tickets
AuditoriumEventTicketsWidget(
widgetId: "your-widget-id",
language: "en",
environment: TicketKOEnvironment.production,
onTicketOrderUpdated: (data) {
// Handle ticket order updates
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Order updated: ${data['id']}')),
);
},
)
Time Period Event Tickets
TicketKOTimePeriodEventsWidget(
widgetId: "your-widget-id",
language: "en",
environment: TicketKOEnvironment.test,
onTicketOrderUpdated: (data) {
// Handle ticket order updates
},
)
Standalone Tickets and Vouchers
StandaloneTicketsAndVouchersWidget(
widgetId: "your-widget-id",
language: "en",
environment: TicketKOEnvironment.test,
onTicketOrderUpdated: (data) {
// Handle ticket order updates
},
)
Catalogue Widget
CatalogueWidget(
widgetId: "your-widget-id",
language: "en",
environment: TicketKOEnvironment.production,
onTicketOrderUpdated: (data) {
// Handle ticket order updates
},
)
Complete Example
import 'package:flutter/material.dart';
import 'package:ticketko_widgets/ticketko_widgets.dart';
class TicketPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Event Tickets')),
body: AuditoriumlessEventTicketsWidget(
widgetId: "your-widget-id",
language: "en",
environment: TicketKOEnvironment.test,
onTicketOrderUpdated: (data) {
// Handle the ticket order update
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Ticket order updated: ${data['id']}'),
),
);
},
),
);
}
}
Parameters
Required Parameters
widgetId(String) - Your unique TicketKO widget identifierlanguage(String) - Language code for the widget interfaceenvironment(TicketKOEnvironment) - EitherTicketKOEnvironment.testorTicketKOEnvironment.production
Optional Parameters
onTicketOrderUpdated(Function) - Callback function triggered when ticket orders are updated
Environment
- Test Environment: Use
TicketKOEnvironment.testfor development and testing - Production Environment: Use
TicketKOEnvironment.productionfor live applications
Dependencies
This package uses webview_flutter to display the TicketKO widgets. Make sure your app meets the WebView requirements for your target platforms.
Libraries
- ticketko_widgets
- A Flutter package for embedding TicketKO widgets in your app