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

82 lines
2.3 KiB
Dart

import 'package:flutter/material.dart';
import '../../domain/bracket.dart';
import 'match_card.dart';
/// A single column in the bracket tree: a round label at the top, then a
/// vertical stack of [MatchCard]s positioned according to the bracket
/// geometry computed by [BracketTreeWidget].
///
/// The widget itself does not compute spacing — its parent supplies a
/// per-card vertical offset so all rounds align even when match counts
/// differ between columns.
class RoundColumn extends StatelessWidget {
const RoundColumn({
super.key,
required this.round,
required this.cardCenters,
required this.columnWidth,
required this.cardWidth,
required this.cardHeight,
required this.columnHeight,
});
final BracketRound round;
/// Vertical center y-coordinate (in this column's local space) for each
/// match card. Same length as `round.matches`.
final List<double> cardCenters;
final double columnWidth;
final double cardWidth;
final double cardHeight;
final double columnHeight;
static const double labelHeight = 32;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return SizedBox(
width: columnWidth,
height: columnHeight,
child: Column(
children: [
SizedBox(
height: labelHeight,
child: Center(
child: Text(
round.label,
style: theme.textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.w700,
color: theme.colorScheme.primary,
letterSpacing: 0.5,
),
),
),
),
Expanded(
child: Stack(
clipBehavior: Clip.none,
children: [
for (var i = 0; i < round.matches.length; i++)
Positioned(
left: (columnWidth - cardWidth) / 2,
top: cardCenters[i] - cardHeight / 2,
width: cardWidth,
child: MatchCard(
match: round.matches[i],
width: cardWidth,
height: cardHeight,
),
),
],
),
),
],
),
);
}
}