Files
philip b239ae3e5f Initial commit: Flutter app + PHP/MySQL backend on Hostinger
Replaces Firebase with a self-hosted PHP/MySQL API served from
winded.prymsolutions.com. Includes full backend (schema, auth, events,
teams, brackets, suggestions, stats, media, file upload) and updated
Flutter repositories and domain models.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 20:13:57 -07:00

29 lines
807 B
Dart

import 'package:riverpod_annotation/riverpod_annotation.dart';
import '../domain/event.dart';
import '../infrastructure/events_repository.dart';
part 'events_notifier.g.dart';
/// Holds the currently-selected event id used when navigating to the detail
/// screen. Null when no event is selected.
@riverpod
class SelectedEventId extends _$SelectedEventId {
@override
String? build() => null;
void select(String? id) => state = id;
}
/// Resolves a single [Event] by id out of the events stream. Returns null
/// while loading or if no event matches.
@riverpod
Event? eventById(EventByIdRef ref, String id) {
final events = ref.watch(eventsStreamProvider).valueOrNull;
if (events == null) return null;
for (final event in events) {
if (event.id == id) return event;
}
return null;
}