Vihaya SDK for Flutter & Dart โ Official vihaya_sdk_flutter Package
vihaya_sdk_flutteris the official Flutter and Dart SDK for the Vihaya Events platform. Build attendee-facing mobile experiences for Android, iOS, Web, macOS, Windows, and Linux โ event listings, registration flows, ticketing, Razorpay payment verification, attendee dashboards, QR check-in, and rich event pages โ with a tiny, fully-typed Dart client.
Vihaya is the modern events platform for India โ a single stack for event organisers, ticketing, sponsor management, attendee registration, live check-in, and real-time analytics. This package is the fastest way to integrate the Vihaya Events API (https://events.vihaya.app) into any Flutter app or pure-Dart program.
Table of contents
- What is Vihaya?
- Why the Vihaya Flutter SDK?
- The Vihaya SDK family
- Installation
- Get your Vihaya API key
- Quick start
- Configuration
- Core concepts
- Usage guide
- Flutter widget patterns
- Mega events & sub-events
- Razorpay payment flow
- API reference
- Error handling
- Security best practices
- FAQ
- Keywords
- Development
- Contributing
- License
๐ฎ๐ณ What is Vihaya?
Vihaya is an all-in-one events platform for India, built for organisers who run college fests, hackathons, conferences, workshops, meetups, bootcamps, summits, and corporate events. The Vihaya platform provides:
- ๐๏ธ Event creation & ticketing with pricing tiers, promo codes, and a hosted checkout.
- ๐ข Mega events โ bundle dozens of sub-events under one parent fest.
- ๐ณ Razorpay payments โ end-to-end with server-side signature verification.
- ๐ Custom registration fields โ T-shirt size, college, team members, dietary preferences, accommodation.
- ๐ฅ Attendee management โ real-time registrations, broadcasts, CSV exports.
- ๐ฑ Live check-in with mobile QR scanning.
- ๐ฉโ๐ซ Speakers, agenda, sponsors, FAQs.
- ๐ Analytics โ registrations, revenue, funnel tracking.
This vihaya_sdk_flutter package lets Flutter and Dart developers embed the Vihaya Events API into mobile apps, web apps, desktop apps, and pure Dart server-side projects.
Production URL: https://events.vihaya.app ยท Marketing site: https://vihaya.app ยท Developer dashboard: https://events.vihaya.app/profile/developer
โจ Why the Vihaya Flutter SDK?
- ๐ True cross-platform โ works on Android, iOS, Web, macOS, Windows, and Linux. One codebase.
- ๐ Fully typed โ every Vihaya response is a typed Dart class with
fromJson/toJson. - ๐ฆ Tiny โ built on
package:http, no native code, no platform channels. - ๐ฏ Pure Dart โ works in Flutter apps and pure Dart (CLI tools, server-side, build scripts).
- ๐งช Tested against the live
events.vihaya.appproduction API. - ๐๏ธ Rich models โ
Event,Speaker,AgendaItem,Sponsor,FAQItem,CustomField,SpecialPrice,PromoCode,RegisterData, sub-events, team registrations. - ๐ณ Razorpay ready โ
client.events.register()โ Razorpay โclient.payments.verify(). - ๐ Stream-friendly โ easy to wrap in
FutureBuilder,StreamBuilder, Riverpod, BLoC, or GetX.
๐ The Vihaya SDK family (7 languages)
| Language | Package | Repository | Install |
|---|---|---|---|
| ๐ฑ Flutter / Dart | vihaya_sdk_flutter |
Vishnu252005/vihaya-sdk-flutter | flutter pub add vihaya_sdk_flutter |
| ๐จ JavaScript / TypeScript | vihaya-sdk |
Vishnu252005/vihaya-sdk | npm install vihaya-sdk |
| ๐ Python | vihaya-events |
Vishnu252005/vihaya-sdk-python | pip install vihaya-events |
| ๐ฆซ Go | vihaya-sdk-go |
Vishnu252005/vihaya-sdk-go | go get github.com/Vishnu252005/vihaya-sdk-go |
| โ Java | vihaya-sdk-java |
Vishnu252005/vihaya-sdk-java | JitPack / Gradle / Maven |
| ๐ Ruby | vihaya-events |
Vishnu252005/vihaya-sdk-ruby | gem install vihaya-events |
| ๐ PHP | vihaya/events |
Vishnu252005/vihaya-sdk-php | composer require vihaya/events |
All Vihaya SDKs target the same API base URL (https://events.vihaya.app), authenticate with the same x-api-key header, and expose the same methods.
๐ฆ Installation
Add to your pubspec.yaml:
dependencies:
vihaya_sdk_flutter: ^0.1.0
Then install:
flutter pub get
Or use the CLI:
flutter pub add vihaya_sdk_flutter
For pure Dart projects (no Flutter):
dart pub add vihaya_sdk_flutter
The package supports Android, iOS, Web, macOS, Windows, and Linux, and Dart SDK 3.0+.
๐ Get your Vihaya API key
- Sign up or log in at events.vihaya.app.
- Open the Developer Dashboard.
- Click Generate API Key and copy the
vh_live_...token. - Store it securely โ
flutter_secure_storage,--dart-defineat build time, or proxy through your own backend.
โ ๏ธ Mobile security note: never ship a
vh_live_...secret key inside your APK/IPA. Always proxy registrations through your own backend, or use a restricted public key scoped to read-only event listing.
๐ Quick start
import 'package:vihaya_sdk_flutter/vihaya_sdk_flutter.dart';
void main() async {
final client = VihayaClient('YOUR_API_KEY');
final events = await client.events.list();
for (final event in events) {
print('${event.title} โ ${event.location}');
}
}
List events with error handling
try {
final events = await client.events.list();
for (final event in events) {
print('${event.title} โ ${event.location}');
}
} on VihayaException catch (e) {
print('Vihaya error: ${e.message} (status ${e.status})');
}
Register an attendee
final registration = RegisterData(
name: 'Anjali Mehta',
email: 'anjali@example.com',
phone: '+919820012345',
customFields: {
'T-Shirt Size': 'L',
'College': 'Vihaya Institute',
},
);
final response = await client.events.register('evt_8x42j9', registration);
if (response['isPaid'] == true) {
final orderId = response['orderId'];
// Launch Razorpay Checkout with orderId, then verify server-side
await client.payments.verify(
paymentId: 'pay_xxx',
orderId: orderId,
signature: 'sig_xxx',
);
} else {
print('Registered! ID: ${response['registrationId']}');
}
โ๏ธ Configuration
import 'package:vihaya_sdk_flutter/vihaya_sdk_flutter.dart';
// Simple constructor
final client = VihayaClient('vh_live_...');
// With full configuration
final client = VihayaClient(VihayaConfig(
apiKey: 'vh_live_...',
baseUrl: 'https://events.vihaya.app', // override for staging
headers: {
'X-Trace-Id': 'abc123',
},
timeout: const Duration(seconds: 60),
));
๐งญ Core concepts
- Events โ the root record. Title, description, date, venue, tiers, custom fields, speakers, agenda, sponsors, FAQs, sub-events.
- Mega events โ parent events containing sub-events. Detect with
event.eventType == 'megaEvent', iterate viaevent.subEvents. - Registrations โ free or paid attendee entries with optional custom fields and team members.
- Payments โ Razorpay orders created during
events.register, verified viapayments.verify. - API key โ
vh_live_...token from the developer dashboard.
๐ Usage guide
Fetch a full event
events.get() returns an Event with everything you need to render a rich event page or build a custom registration form โ speakers, agenda, sponsors, FAQs, custom fields, and pricing tiers.
final event = await client.events.get('event-id');
print('Title: ${event.title}');
print('Mode: ${event.eventMode}');
print('Timezone: ${event.timezone}');
print('Date: ${event.date} ${event.time}');
print('Location: ${event.location}');
event.speakerList?.forEach((s) => print('- ${s.name} (${s.role}) @ ${s.company}'));
event.agendaList?.forEach((a) => print('[${a.time}] ${a.title}'));
event.sponsors?.forEach((sp) => print('${sp.name} (${sp.tier})'));
event.faqs?.forEach((faq) => print('Q: ${faq.question}\nA: ${faq.answer}\n'));
event.specialPrices?.forEach((tier) => print(' ${tier.name}: โน${tier.amount}'));
event.customFields?.forEach((field) {
final req = field.required ? 'required' : 'optional';
print(' ${field.name} [${field.type}] $req');
});
List & filter events
final events = await client.events.list();
final mega = events.where((e) => e.eventType == 'megaEvent').toList();
final freeOnes = events.where((e) => e.isFree == true).toList();
final online = events.where((e) => e.eventMode == 'online').toList();
Register with tiers, promo codes, and custom fields
await client.events.register('evt_conf_2026', RegisterData(
name: 'Priya Raj',
email: 'priya@example.com',
phone: '+919820012345',
tier: 'Early Bird',
promoCode: 'LAUNCH10',
customFields: {
'College': 'IIT Bombay',
'T-Shirt Size': 'M',
'Year of Study': '3rd',
},
));
Register a hackathon team
await client.events.register('evt_hackathon_2026', RegisterData(
name: 'Team Lead',
email: 'lead@example.com',
phone: '+919820012345',
teamName: 'Byte Squad',
teamMembers: [
{'name': 'Alice', 'email': 'alice@example.com', 'phone': '+91...'},
{'name': 'Bob', 'email': 'bob@example.com', 'phone': '+91...'},
{'name': 'Carol', 'email': 'carol@example.com', 'phone': '+91...'},
],
));
๐งฑ Flutter widget patterns
FutureBuilder event list
class EventListScreen extends StatelessWidget {
final VihayaClient client;
const EventListScreen({super.key, required this.client});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Vihaya Events')),
body: FutureBuilder<List<Event>>(
future: client.events.list(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator());
}
if (snapshot.hasError) {
return Center(child: Text('Error: ${snapshot.error}'));
}
final events = snapshot.data!;
return ListView.builder(
itemCount: events.length,
itemBuilder: (_, i) {
final event = events[i];
return ListTile(
title: Text(event.title),
subtitle: Text('${event.date} ยท ${event.location}'),
onTap: () => Navigator.push(context, MaterialPageRoute(
builder: (_) => EventDetailScreen(client: client, eventId: event.id),
)),
);
},
);
},
),
);
}
}
Riverpod provider
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:vihaya_sdk_flutter/vihaya_sdk_flutter.dart';
final vihayaProvider = Provider<VihayaClient>(
(ref) => VihayaClient('YOUR_API_KEY'),
);
final eventsProvider = FutureProvider<List<Event>>((ref) async {
return ref.watch(vihayaProvider).events.list();
});
final eventDetailProvider = FutureProvider.family<Event, String>((ref, id) async {
return ref.watch(vihayaProvider).events.get(id);
});
class EventListPage extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final eventsAsync = ref.watch(eventsProvider);
return eventsAsync.when(
data: (events) => ListView(
children: events.map((e) => ListTile(title: Text(e.title))).toList(),
),
loading: () => const CircularProgressIndicator(),
error: (err, _) => Text('Error: $err'),
);
}
}
BLoC
class EventBloc extends Bloc<EventEvent, EventState> {
final VihayaClient client;
EventBloc(this.client) : super(EventInitial()) {
on<LoadEvents>((event, emit) async {
emit(EventLoading());
try {
final events = await client.events.list();
emit(EventLoaded(events));
} on VihayaException catch (e) {
emit(EventError(e.message));
}
});
}
}
Building a dynamic registration form
The Vihaya SDK gives you everything to render a dynamic registration form in a single events.get() call โ pricing tiers, custom fields, accommodation options.
class EventRegistrationForm extends StatefulWidget {
final Event event;
// ...
@override
Widget build(BuildContext context) {
return Column(
children: [
// Tiers
if (event.specialPrices != null)
...event.specialPrices!.map((tier) => RadioListTile<String>(
title: Text('${tier.name} โ โน${tier.amount}'),
value: tier.name,
groupValue: selectedTier,
onChanged: (v) => setState(() => selectedTier = v),
)),
// Custom fields
if (event.customFields != null)
...event.customFields!.map((field) {
if (field.type == 'dropdown') {
return DropdownButtonFormField<String>(
decoration: InputDecoration(labelText: field.name),
items: field.options
?.map((o) => DropdownMenuItem(value: o, child: Text(o)))
.toList(),
onChanged: (v) => customFieldValues[field.name] = v ?? '',
);
}
return TextFormField(
decoration: InputDecoration(labelText: field.name),
onChanged: (v) => customFieldValues[field.name] = v,
);
}),
// Accommodation
if (event.hasAccommodation == true)
CheckboxListTile(
title: Text('Accommodation (โน${event.accommodationPrice})'),
subtitle: Text(event.accommodationDetails ?? ''),
value: needsAccommodation,
onChanged: (v) => setState(() => needsAccommodation = v ?? false),
),
// Submit
ElevatedButton(
onPressed: _submit,
child: const Text('Register'),
),
],
);
}
}
๐ข Mega events & sub-events
final fest = await client.events.get('evt_mega_fest_2026');
if (fest.eventType == 'megaEvent') {
print('${fest.title} โ ${fest.subEvents?.length ?? 0} sub-events');
fest.subEvents?.forEach((sub) {
final price = sub.isFree == true ? 'Free' : 'โน${sub.price}';
print(' - ${sub.title} ($price)');
sub.customFields?.forEach((field) {
print(' * ${field.name} [${field.type}]');
});
});
}
Register for a specific sub-event:
await client.events.register('evt_sub_workshop_ml', RegisterData(
name: 'Rahul',
email: 'rahul@example.com',
phone: '+91...',
));
๐ณ Razorpay payment flow
Vihaya uses Razorpay for payments. The flow integrates beautifully with the official razorpay_flutter package:
- Backend (your server) โ proxy
client.events.register(eventId, data)โ returnsorderId. - Flutter app โ launch
Razorpay()checkout withorder_id: orderId. - Razorpay callback โ
_handlePaymentSuccess(PaymentSuccessResponse response). - Backend โ call
client.payments.verify(...)to mark the registration paid.
import 'package:razorpay_flutter/razorpay_flutter.dart';
class CheckoutFlow {
final Razorpay _razorpay = Razorpay();
final VihayaClient client;
late String currentOrderId;
CheckoutFlow(this.client) {
_razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _onSuccess);
_razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _onError);
}
Future<void> startCheckout(String eventId, RegisterData data) async {
final result = await client.events.register(eventId, data);
currentOrderId = result['orderId'];
_razorpay.open({
'key': 'rzp_live_xxx',
'amount': result['amount'],
'order_id': currentOrderId,
'name': 'Vihaya Events',
'prefill': {'contact': data.phone, 'email': data.email},
});
}
void _onSuccess(PaymentSuccessResponse response) async {
await client.payments.verify(
paymentId: response.paymentId!,
orderId: response.orderId!,
signature: response.signature!,
);
}
void _onError(PaymentFailureResponse response) {
// handle error
}
}
โ ๏ธ Always verify payments on the server. Never trust a signature checked only on-device. Proxy
payments.verifythrough your own backend.
๐ API reference
VihayaClient(apiKey) / VihayaClient(VihayaConfig(...))
The main client.
client.events
| Method | Description |
|---|---|
list() |
Returns all active events on the authenticated account. |
get(id) |
Full metadata for one event including tiers, fields, agenda, speakers, sponsors, FAQs, sub-events. |
register(id, data) |
Submits a registration. Returns orderId for paid events, registrationId for free. |
client.payments
| Method | Description |
|---|---|
verify(paymentId, orderId, signature) |
Server-side Razorpay signature verification. |
Models
Eventโ root event with all metadataSpeaker,Sponsor,AgendaItem,FAQItem,ContactCustomField,SpecialPrice,PromoCodeRegisterDataโ registration payloadVihayaConfigโ client configurationVihayaExceptionโ thrown on every API failure
๐จ Error handling
All API failures raise VihayaException:
try {
await client.events.get('invalid-id');
} on VihayaException catch (e) {
print('Message: ${e.message}');
print('Status: ${e.status}');
print('Body: ${e.data}');
switch (e.status) {
case 404: /* not found */ break;
case 401:
case 403: /* auth */ break;
case 429: /* rate limit */ break;
}
}
๐ก๏ธ Security best practices
Never hard-code your
vh_live_...secret key in a Flutter build that ships to end-users.
- Ship only restricted public keys to mobile apps. Keep the secret on your backend.
- Proxy
events.registerandpayments.verifythrough your own server for sensitive operations. - Use
flutter_secure_storageor platform secure storage for any short-lived tokens. - Pass keys at build time via
--dart-define=VIHAYA_API_KEY=...rather than committing them. - Always verify Razorpay signatures server-side.
- Rotate keys via the Vihaya developer dashboard if leaked.
โ FAQ
What is Vihaya?
Vihaya is an events platform for India โ ticketing, registrations, payments, check-in, analytics, and attendee management. Platform: vihaya.app. Dashboard: events.vihaya.app.
Does the SDK work on Web, macOS, Windows, and Linux?
Yes. It's built on package:http which works on all six Flutter platforms.
Does it work in pure Dart (no Flutter)?
Yes. The package has no Flutter-specific dependencies โ use it in CLI tools, server-side Dart, build scripts, or Dart Edge.
Does it work with Riverpod, BLoC, GetX, Provider, MobX?
Yes. The client is a plain Dart object โ wrap it in any state management pattern you prefer.
How do I integrate with razorpay_flutter?
See the Razorpay payment flow section above. The Vihaya SDK creates the order; razorpay_flutter opens checkout; the SDK verifies the signature server-side.
Can I ship my live secret key in the APK?
No. Always proxy through your own backend or use a restricted public key. Mobile binaries can be reverse-engineered.
๐ Keywords
vihaya ยท vihaya sdk ยท vihaya flutter ยท vihaya dart ยท vihaya sdk flutter ยท vihaya_sdk_flutter ยท vihaya events flutter ยท vihaya api flutter ยท flutter events api ยท flutter ticketing sdk ยท flutter razorpay events ยท vihaya razorpay flutter ยท events api india flutter ยท event management sdk flutter ยท dart events sdk ยท riverpod vihaya ยท bloc vihaya ยท getx vihaya ยท flutter event app ยท pub.dev vihaya ยท events.vihaya.app flutter ยท vihaya official flutter sdk ยท dart pub vihaya
๐ ๏ธ Development
git clone https://github.com/Vishnu252005/vihaya-sdk-flutter.git
cd vihaya-sdk-flutter
flutter pub get
flutter test
dart analyze
๐ค Contributing
Contributions to the Vihaya Flutter SDK are very welcome. The project is open source and MIT-licensed.
- Fork Vishnu252005/vihaya-sdk-flutter.
- Create a feature branch.
- Run
flutter testanddart analyze. - Commit, push, and open a Pull Request.
Reporting issues
Found a bug or have a feature request? Open an issue at github.com/Vishnu252005/vihaya-sdk-flutter/issues.
๐ License
MIT ยฉ Vihaya. See LICENSE.
๐ฌ Support
- ๐ง Email: support@vihaya.app
- ๐ Website: vihaya.app
- ๐ ๏ธ Dashboard: events.vihaya.app
- ๐จโ๐ป Developer docs: events.vihaya.app/profile/developer/docs
- ๐ฆ pub.dev: pub.dev/packages/vihaya_sdk_flutter
- ๐ Issues: github.com/Vishnu252005/vihaya-sdk-flutter/issues
Built with โค๏ธ by the Vihaya team.
Related Vihaya SDK repositories
- Flutter / Dart: vihaya-sdk-flutter โ you are here
- JavaScript / TypeScript: vihaya-sdk
- Python: vihaya-sdk-python
- Go: vihaya-sdk-go
- Java: vihaya-sdk-java
- Ruby: vihaya-sdk-ruby
- PHP: vihaya-sdk-php
Libraries
- vihaya_sdk_flutter
- Official Flutter SDK for the Vihaya Events platform.