Added comments
This commit is contained in:
@@ -15,6 +15,13 @@ import 'package:confetti/confetti.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Displays the active game view, showing game details, player rankings, rounds, and statistics.
|
||||
///
|
||||
/// This view allows users to interact with an ongoing game session, including viewing player scores,
|
||||
/// navigating through rounds, ending or deleting the game, exporting game data, and starting a new game
|
||||
/// with the same settings. It also provides visual feedback such as confetti animation when the game ends.
|
||||
///
|
||||
/// The widget listens to changes in the provided [GameSession] and updates the UI accordingly.
|
||||
class ActiveGameView extends StatefulWidget {
|
||||
final GameSession gameSession;
|
||||
const ActiveGameView({super.key, required this.gameSession});
|
||||
|
||||
@@ -4,6 +4,11 @@ import 'package:cabo_counter/l10n/generated/app_localizations.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:syncfusion_flutter_charts/charts.dart';
|
||||
|
||||
/// A widget that displays the cumulative scoring history of a game session as a line graph.
|
||||
///
|
||||
/// The [GraphView] visualizes the progression of each player's score over multiple rounds
|
||||
/// using a line chart. It supports dynamic coloring for each player, axis formatting,
|
||||
/// and handles cases where insufficient data is available to render the graph.
|
||||
class GraphView extends StatefulWidget {
|
||||
final GameSession gameSession;
|
||||
|
||||
|
||||
@@ -8,6 +8,12 @@ enum GameMode {
|
||||
unlimited,
|
||||
}
|
||||
|
||||
/// A stateless widget that displays a menu for selecting the game mode.
|
||||
///
|
||||
/// The [ModeSelectionMenu] allows the user to choose between different game modes:
|
||||
/// - Point limit mode with a specified [pointLimit]
|
||||
/// - Unlimited mode
|
||||
/// - Optionally, no default mode if [showDeselection] is true
|
||||
class ModeSelectionMenu extends StatelessWidget {
|
||||
final int pointLimit;
|
||||
final bool showDeselection;
|
||||
|
||||
@@ -4,6 +4,13 @@ import 'package:cabo_counter/l10n/generated/app_localizations.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Displays an overview of points for each player and round in the current game session.
|
||||
///
|
||||
/// The [PointsView] widget shows a table with all rounds and player scores,
|
||||
/// including score updates and highlights for players who said "Cabo".
|
||||
/// It uses a Cupertino-style layout and adapts to the number of players.
|
||||
///
|
||||
/// Requires a [GameSession] to provide player and round data.
|
||||
class PointsView extends StatefulWidget {
|
||||
final GameSession gameSession;
|
||||
|
||||
|
||||
@@ -8,6 +8,19 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
/// A view for displaying and managing a single round
|
||||
///
|
||||
/// This widget allows users to input and review scores for each player in a round,
|
||||
/// select the player who called CABO, and handle special cases such as Kamikaze rounds.
|
||||
/// It manages the round state, validates input, and coordinates navigation between rounds.
|
||||
///
|
||||
/// Features:
|
||||
/// - Rotates player order based on the previous round's winner.
|
||||
/// - Supports Kamikaze rounds with dedicated UI and logic.
|
||||
/// - Handles score input, validation, and updates to the game session.
|
||||
/// - Displays bonus point popups when applicable.
|
||||
///
|
||||
/// Requires a [GameSession] and the current [roundNumber].
|
||||
class RoundView extends StatefulWidget {
|
||||
final GameSession gameSession;
|
||||
final int roundNumber;
|
||||
|
||||
Reference in New Issue
Block a user