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;
|
||||
|
||||
@@ -20,6 +20,12 @@ enum CreateStatus {
|
||||
noPlayerName,
|
||||
}
|
||||
|
||||
/// A view for creating a new game session in the Cabo Counter app.
|
||||
///
|
||||
/// The [CreateGameView] allows users to input a game title, select a game mode,
|
||||
/// add and reorder player names, and validate all required fields before
|
||||
/// starting a new game. It provides feedback dialogs for missing or invalid
|
||||
/// input and navigates to the active game view upon successful creation.
|
||||
class CreateGameView extends StatefulWidget {
|
||||
final GameMode gameMode;
|
||||
final String? gameTitle;
|
||||
|
||||
@@ -16,6 +16,11 @@ enum PreRatingDialogDecision { yes, no, cancel }
|
||||
|
||||
enum BadRatingDialogDecision { email, cancel }
|
||||
|
||||
/// Home screen of the app that displays a list of game sessions.
|
||||
///
|
||||
/// The [MainMenuView] is the main entry point for the app's home screen.
|
||||
/// It displays a list of existing game sessions, allows users to create new games,
|
||||
/// access settings, and handles user feedback dialogs for app rating and support.
|
||||
class MainMenuView extends StatefulWidget {
|
||||
const MainMenuView({super.key});
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
/// Settings and information page for the app.
|
||||
///
|
||||
/// [SettingsView] is a settings page for the app, allowing users to configure game options,
|
||||
/// manage game data (import, export, delete), and view app information.
|
||||
class SettingsView extends StatefulWidget {
|
||||
const SettingsView({super.key});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user