Updated and added comments
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m4s
Pull Request Pipeline / lint (pull_request) Successful in 2m9s

This commit is contained in:
2026-01-13 22:24:31 +01:00
parent e483fc38f3
commit bb79eecdfd
39 changed files with 177 additions and 219 deletions

View File

@@ -12,6 +12,8 @@ import 'package:game_tracker/presentation/views/main_menu/statistics_view.dart';
import 'package:game_tracker/presentation/widgets/navbar_item.dart';
class CustomNavigationBar extends StatefulWidget {
/// A custom navigation bar widget that provides tabbed navigation
/// between different views: Home, Matches, Groups, and Statistics.
const CustomNavigationBar({super.key});
@override

View File

@@ -11,6 +11,7 @@ import 'package:game_tracker/presentation/widgets/text_input/text_input_field.da
import 'package:provider/provider.dart';
class CreateGroupView extends StatefulWidget {
/// A view that allows the user to create a new group
const CreateGroupView({super.key});
@override

View File

@@ -14,6 +14,7 @@ import 'package:game_tracker/presentation/widgets/top_centered_message.dart';
import 'package:provider/provider.dart';
class GroupsView extends StatefulWidget {
/// A view that displays a list of groups
const GroupsView({super.key});
@override

View File

@@ -15,6 +15,8 @@ import 'package:game_tracker/presentation/widgets/tiles/quick_info_tile.dart';
import 'package:provider/provider.dart';
class HomeView extends StatefulWidget {
/// The main home view of the application, displaying quick info,
/// recent matches, and quick create options.
const HomeView({super.key});
@override

View File

@@ -6,15 +6,21 @@ import 'package:game_tracker/presentation/widgets/text_input/custom_search_bar.d
import 'package:game_tracker/presentation/widgets/tiles/title_description_list_tile.dart';
class ChooseGameView extends StatefulWidget {
final List<(String, String, Ruleset)> games;
final int initialGameIndex;
/// A view that allows the user to choose a game from a list of available games
/// - [games]: A list of tuples containing the game name, description and ruleset
/// - [initialGameIndex]: The index of the initially selected game
const ChooseGameView({
super.key,
required this.games,
required this.initialGameIndex,
});
/// A list of tuples containing the game name, description and ruleset
final List<(String, String, Ruleset)> games;
/// The index of the initially selected game
final int initialGameIndex;
@override
State<ChooseGameView> createState() => _ChooseGameViewState();
}

View File

@@ -7,15 +7,21 @@ import 'package:game_tracker/presentation/widgets/tiles/group_tile.dart';
import 'package:game_tracker/presentation/widgets/top_centered_message.dart';
class ChooseGroupView extends StatefulWidget {
final List<Group> groups;
final String initialGroupId;
/// A view that allows the user to choose a group from a list of groups.
/// - [groups]: A list of available groups to choose from
/// - [initialGroupId]: The ID of the initially selected group
const ChooseGroupView({
super.key,
required this.groups,
required this.initialGroupId,
});
/// A list of available groups to choose from
final List<Group> groups;
/// The ID of the initially selected group
final String initialGroupId;
@override
State<ChooseGroupView> createState() => _ChooseGroupViewState();
}
@@ -140,10 +146,11 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
filteredGroups.clear();
filteredGroups.addAll(
widget.groups.where(
(group) =>
group.name.toLowerCase().contains(query.toLowerCase()) ||
(group) =>
group.name.toLowerCase().contains(query.toLowerCase()) ||
group.members.any(
(player) => player.name.toLowerCase().contains(query.toLowerCase()),
(player) =>
player.name.toLowerCase().contains(query.toLowerCase()),
),
),
);

View File

@@ -5,15 +5,21 @@ import 'package:game_tracker/l10n/generated/app_localizations.dart';
import 'package:game_tracker/presentation/widgets/tiles/title_description_list_tile.dart';
class ChooseRulesetView extends StatefulWidget {
final List<(Ruleset, String)> rulesets;
final int initialRulesetIndex;
/// A view that allows the user to choose a ruleset from a list of available rulesets
/// - [rulesets]: A list of tuples containing the ruleset and its description
/// - [initialRulesetIndex]: The index of the initially selected ruleset
const ChooseRulesetView({
super.key,
required this.rulesets,
required this.initialRulesetIndex,
});
/// A list of tuples containing the ruleset and its description
final List<(Ruleset, String)> rulesets;
/// The index of the initially selected ruleset
final int initialRulesetIndex;
@override
State<ChooseRulesetView> createState() => _ChooseRulesetViewState();
}

View File

@@ -18,9 +18,13 @@ import 'package:game_tracker/presentation/widgets/tiles/choose_tile.dart';
import 'package:provider/provider.dart';
class CreateMatchView extends StatefulWidget {
final VoidCallback? onWinnerChanged;
/// A view that allows creating a new match
/// [onWinnerChanged]: Optional callback invoked when the winner is changed
const CreateMatchView({super.key, this.onWinnerChanged});
/// Optional callback invoked when the winner is changed
final VoidCallback? onWinnerChanged;
@override
State<CreateMatchView> createState() => _CreateMatchViewState();
}
@@ -202,7 +206,8 @@ class _CreateMatchViewState extends State<CreateMatchView> {
if (selectedGroup != null) {
filteredPlayerList = playerList
.where(
(p) => !selectedGroup!.members.any((m) => m.id == p.id),
(p) =>
!selectedGroup!.members.any((m) => m.id == p.id),
)
.toList();
} else {

View File

@@ -8,11 +8,17 @@ import 'package:game_tracker/presentation/widgets/tiles/custom_radio_list_tile.d
import 'package:provider/provider.dart';
class MatchResultView extends StatefulWidget {
/// A view that allows selecting and saving the winner of a match
/// [match]: The match for which the winner is to be selected
/// [onWinnerChanged]: Optional callback invoked when the winner is changed
const MatchResultView({super.key, required this.match, this.onWinnerChanged});
/// The match for which the winner is to be selected
final Match match;
/// Optional callback invoked when the winner is changed
final VoidCallback? onWinnerChanged;
const MatchResultView({super.key, required this.match, this.onWinnerChanged});
@override
State<MatchResultView> createState() => _MatchResultViewState();
}

View File

@@ -19,6 +19,7 @@ import 'package:game_tracker/presentation/widgets/top_centered_message.dart';
import 'package:provider/provider.dart';
class MatchView extends StatefulWidget {
/// A view that displays a list of matches
const MatchView({super.key});
@override

View File

@@ -5,10 +5,13 @@ import 'package:game_tracker/presentation/views/main_menu/settings_view/licenses
import 'package:url_launcher/url_launcher.dart';
class LicenseDetailView extends StatelessWidget {
final Package package;
/// A detailed view displaying information about a software package license.
/// - [package]: The package data to be displayed.
const LicenseDetailView({super.key, required this.package});
/// The package data to be displayed.
final Package package;
@override
Widget build(BuildContext context) {
final loc = AppLocalizations.of(context);

View File

@@ -5,6 +5,7 @@ import 'package:game_tracker/presentation/views/main_menu/settings_view/licenses
import 'package:game_tracker/presentation/widgets/tiles/license_tile.dart';
class LicensesView extends StatelessWidget {
/// A view that displays a list of open source licenses used in the app
const LicensesView({super.key});
@override

View File

@@ -14,6 +14,8 @@ import 'package:package_info_plus/package_info_plus.dart';
import 'package:url_launcher/url_launcher.dart';
class SettingsView extends StatefulWidget {
/// The settings view of the application, allowing users to manage data
/// and view legal information.
const SettingsView({super.key});
@override

View File

@@ -10,6 +10,7 @@ import 'package:game_tracker/presentation/widgets/top_centered_message.dart';
import 'package:provider/provider.dart';
class StatisticsView extends StatefulWidget {
/// A view that displays player statistics
const StatisticsView({super.key});
@override