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>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
import '../domain/bracket.dart';
|
||||
import '../infrastructure/brackets_repository.dart';
|
||||
|
||||
part 'brackets_notifier.g.dart';
|
||||
|
||||
/// Currently-selected bracket id used when navigating to the detail screen.
|
||||
@riverpod
|
||||
class SelectedBracketId extends _$SelectedBracketId {
|
||||
@override
|
||||
String? build() => null;
|
||||
|
||||
void select(String? id) => state = id;
|
||||
}
|
||||
|
||||
/// Resolves a single [Bracket] by id out of the brackets stream. Returns null
|
||||
/// while loading or if no bracket matches.
|
||||
@riverpod
|
||||
Bracket? bracketById(BracketByIdRef ref, String id) {
|
||||
final brackets = ref.watch(bracketsStreamProvider).valueOrNull;
|
||||
if (brackets == null) return null;
|
||||
for (final bracket in brackets) {
|
||||
if (bracket.id == id) return bracket;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user