Updated and added comments
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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()),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user