Compare commits
11 Commits
c43b7b478c
...
enhancemen
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c4eff5056 | |||
| ad2e4bc398 | |||
| 2ad3698067 | |||
| 32e1c587d4 | |||
| 55437d83c4 | |||
| 15702a108d | |||
| 36fda30f27 | |||
| 1ab869ec26 | |||
| 52b78e44e4 | |||
| e827f4c527 | |||
| 73c85b1ff2 |
@@ -30,9 +30,11 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
|
||||
final players =
|
||||
await db.playerMatchDao.getPlayersOfMatch(matchId: row.id) ?? [];
|
||||
|
||||
final scores = await db.scoreDao.getAllMatchScores(matchId: row.id);
|
||||
final scores = await db.scoreEntryDao.getAllMatchScores(
|
||||
matchId: row.id,
|
||||
);
|
||||
|
||||
final winner = await db.scoreDao.getWinner(matchId: row.id);
|
||||
final winner = await db.scoreEntryDao.getWinner(matchId: row.id);
|
||||
return Match(
|
||||
id: row.id,
|
||||
name: row.name,
|
||||
@@ -64,9 +66,9 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
|
||||
final players =
|
||||
await db.playerMatchDao.getPlayersOfMatch(matchId: matchId) ?? [];
|
||||
|
||||
final scores = await db.scoreDao.getAllMatchScores(matchId: matchId);
|
||||
final scores = await db.scoreEntryDao.getAllMatchScores(matchId: matchId);
|
||||
|
||||
final winner = await db.scoreDao.getWinner(matchId: matchId);
|
||||
final winner = await db.scoreEntryDao.getWinner(matchId: matchId);
|
||||
|
||||
return Match(
|
||||
id: result.id,
|
||||
@@ -109,7 +111,7 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
|
||||
|
||||
for (final pid in match.scores.keys) {
|
||||
final playerScores = match.scores[pid]!;
|
||||
await db.scoreDao.addScoresAsList(
|
||||
await db.scoreEntryDao.addScoresAsList(
|
||||
entrys: playerScores,
|
||||
playerId: pid,
|
||||
matchId: match.id,
|
||||
@@ -117,7 +119,7 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
|
||||
}
|
||||
|
||||
if (match.winner != null) {
|
||||
await db.scoreDao.setWinner(
|
||||
await db.scoreEntryDao.setWinner(
|
||||
matchId: match.id,
|
||||
playerId: match.winner!.id,
|
||||
);
|
||||
@@ -298,7 +300,7 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
|
||||
final group = await db.groupDao.getGroupById(groupId: groupId);
|
||||
final players =
|
||||
await db.playerMatchDao.getPlayersOfMatch(matchId: row.id) ?? [];
|
||||
final winner = await db.scoreDao.getWinner(matchId: row.id);
|
||||
final winner = await db.scoreEntryDao.getWinner(matchId: row.id);
|
||||
return Match(
|
||||
id: row.id,
|
||||
name: row.name,
|
||||
|
||||
@@ -6,11 +6,12 @@ import 'package:tallee/data/db/tables/score_entry_table.dart';
|
||||
import 'package:tallee/data/models/player.dart';
|
||||
import 'package:tallee/data/models/score_entry.dart';
|
||||
|
||||
part 'score_dao.g.dart';
|
||||
part 'score_entry_dao.g.dart';
|
||||
|
||||
@DriftAccessor(tables: [ScoreEntryTable])
|
||||
class ScoreDao extends DatabaseAccessor<AppDatabase> with _$ScoreDaoMixin {
|
||||
ScoreDao(super.db);
|
||||
class ScoreEntryDao extends DatabaseAccessor<AppDatabase>
|
||||
with _$ScoreEntryDaoMixin {
|
||||
ScoreEntryDao(super.db);
|
||||
|
||||
/// Adds a score entry to the database.
|
||||
Future<void> addScore({
|
||||
@@ -1,20 +1,20 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'score_dao.dart';
|
||||
part of 'score_entry_dao.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
mixin _$ScoreDaoMixin on DatabaseAccessor<AppDatabase> {
|
||||
mixin _$ScoreEntryDaoMixin on DatabaseAccessor<AppDatabase> {
|
||||
$PlayerTableTable get playerTable => attachedDatabase.playerTable;
|
||||
$GameTableTable get gameTable => attachedDatabase.gameTable;
|
||||
$GroupTableTable get groupTable => attachedDatabase.groupTable;
|
||||
$MatchTableTable get matchTable => attachedDatabase.matchTable;
|
||||
$ScoreEntryTableTable get scoreEntryTable => attachedDatabase.scoreEntryTable;
|
||||
ScoreDaoManager get managers => ScoreDaoManager(this);
|
||||
ScoreEntryDaoManager get managers => ScoreEntryDaoManager(this);
|
||||
}
|
||||
|
||||
class ScoreDaoManager {
|
||||
final _$ScoreDaoMixin _db;
|
||||
ScoreDaoManager(this._db);
|
||||
class ScoreEntryDaoManager {
|
||||
final _$ScoreEntryDaoMixin _db;
|
||||
ScoreEntryDaoManager(this._db);
|
||||
$$PlayerTableTableTableManager get playerTable =>
|
||||
$$PlayerTableTableTableManager(_db.attachedDatabase, _db.playerTable);
|
||||
$$GameTableTableTableManager get gameTable =>
|
||||
@@ -7,7 +7,7 @@ import 'package:tallee/data/dao/match_dao.dart';
|
||||
import 'package:tallee/data/dao/player_dao.dart';
|
||||
import 'package:tallee/data/dao/player_group_dao.dart';
|
||||
import 'package:tallee/data/dao/player_match_dao.dart';
|
||||
import 'package:tallee/data/dao/score_dao.dart';
|
||||
import 'package:tallee/data/dao/score_entry_dao.dart';
|
||||
import 'package:tallee/data/dao/team_dao.dart';
|
||||
import 'package:tallee/data/db/tables/game_table.dart';
|
||||
import 'package:tallee/data/db/tables/group_table.dart';
|
||||
@@ -38,7 +38,7 @@ part 'database.g.dart';
|
||||
PlayerGroupDao,
|
||||
PlayerMatchDao,
|
||||
GameDao,
|
||||
ScoreDao,
|
||||
ScoreEntryDao,
|
||||
TeamDao,
|
||||
],
|
||||
)
|
||||
|
||||
@@ -2710,7 +2710,7 @@ abstract class _$AppDatabase extends GeneratedDatabase {
|
||||
this as AppDatabase,
|
||||
);
|
||||
late final GameDao gameDao = GameDao(this as AppDatabase);
|
||||
late final ScoreDao scoreDao = ScoreDao(this as AppDatabase);
|
||||
late final ScoreEntryDao scoreEntryDao = ScoreEntryDao(this as AppDatabase);
|
||||
late final TeamDao teamDao = TeamDao(this as AppDatabase);
|
||||
@override
|
||||
Iterable<TableInfo<Table, Object?>> get allTables =>
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tallee/core/adaptive_page_route.dart';
|
||||
import 'package:tallee/core/custom_theme.dart';
|
||||
import 'package:tallee/core/enums.dart';
|
||||
import 'package:tallee/data/db/database.dart';
|
||||
import 'package:tallee/data/models/group.dart';
|
||||
import 'package:tallee/data/models/match.dart';
|
||||
@@ -10,10 +11,10 @@ import 'package:tallee/data/models/player.dart';
|
||||
import 'package:tallee/l10n/generated/app_localizations.dart';
|
||||
import 'package:tallee/presentation/views/main_menu/group_view/create_group_view.dart';
|
||||
import 'package:tallee/presentation/widgets/app_skeleton.dart';
|
||||
import 'package:tallee/presentation/widgets/buttons/animated_dialog_button.dart';
|
||||
import 'package:tallee/presentation/widgets/buttons/main_menu_button.dart';
|
||||
import 'package:tallee/presentation/widgets/colored_icon_container.dart';
|
||||
import 'package:tallee/presentation/widgets/custom_alert_dialog.dart';
|
||||
import 'package:tallee/presentation/widgets/dialog/custom_alert_dialog.dart';
|
||||
import 'package:tallee/presentation/widgets/dialog/custom_dialog_action.dart';
|
||||
import 'package:tallee/presentation/widgets/tiles/info_tile.dart';
|
||||
import 'package:tallee/presentation/widgets/tiles/text_icon_tile.dart';
|
||||
|
||||
@@ -70,23 +71,16 @@ class _GroupDetailViewState extends State<GroupDetailView> {
|
||||
context: context,
|
||||
builder: (context) => CustomAlertDialog(
|
||||
title: '${loc.delete_group}?',
|
||||
content: loc.this_cannot_be_undone,
|
||||
content: Text(loc.this_cannot_be_undone),
|
||||
actions: [
|
||||
AnimatedDialogButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(
|
||||
loc.cancel,
|
||||
style: const TextStyle(color: CustomTheme.textColor),
|
||||
),
|
||||
),
|
||||
AnimatedDialogButton(
|
||||
CustomDialogAction(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Text(
|
||||
loc.delete,
|
||||
style: const TextStyle(
|
||||
color: CustomTheme.secondaryColor,
|
||||
),
|
||||
),
|
||||
text: loc.delete,
|
||||
),
|
||||
CustomDialogAction(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
buttonType: ButtonType.secondary,
|
||||
text: loc.cancel,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -227,7 +227,7 @@ class _HomeViewState extends State<HomeView> {
|
||||
/// Updates the winner information for a specific match in the recent matches list.
|
||||
Future<void> updatedWinnerInRecentMatches(String matchId) async {
|
||||
final db = Provider.of<AppDatabase>(context, listen: false);
|
||||
final winner = await db.scoreDao.getWinner(matchId: matchId);
|
||||
final winner = await db.scoreEntryDao.getWinner(matchId: matchId);
|
||||
final matchIndex = recentMatches.indexWhere((match) => match.id == matchId);
|
||||
if (matchIndex != -1) {
|
||||
setState(() {
|
||||
|
||||
@@ -4,15 +4,16 @@ import 'package:provider/provider.dart';
|
||||
import 'package:tallee/core/adaptive_page_route.dart';
|
||||
import 'package:tallee/core/common.dart';
|
||||
import 'package:tallee/core/custom_theme.dart';
|
||||
import 'package:tallee/core/enums.dart';
|
||||
import 'package:tallee/data/db/database.dart';
|
||||
import 'package:tallee/data/models/match.dart';
|
||||
import 'package:tallee/l10n/generated/app_localizations.dart';
|
||||
import 'package:tallee/presentation/views/main_menu/match_view/create_match/create_match_view.dart';
|
||||
import 'package:tallee/presentation/views/main_menu/match_view/match_result_view.dart';
|
||||
import 'package:tallee/presentation/widgets/buttons/animated_dialog_button.dart';
|
||||
import 'package:tallee/presentation/widgets/buttons/main_menu_button.dart';
|
||||
import 'package:tallee/presentation/widgets/colored_icon_container.dart';
|
||||
import 'package:tallee/presentation/widgets/custom_alert_dialog.dart';
|
||||
import 'package:tallee/presentation/widgets/dialog/custom_alert_dialog.dart';
|
||||
import 'package:tallee/presentation/widgets/dialog/custom_dialog_action.dart';
|
||||
import 'package:tallee/presentation/widgets/tiles/info_tile.dart';
|
||||
import 'package:tallee/presentation/widgets/tiles/text_icon_tile.dart';
|
||||
|
||||
@@ -64,23 +65,16 @@ class _MatchDetailViewState extends State<MatchDetailView> {
|
||||
context: context,
|
||||
builder: (context) => CustomAlertDialog(
|
||||
title: '${loc.delete_match}?',
|
||||
content: loc.this_cannot_be_undone,
|
||||
content: Text(loc.this_cannot_be_undone),
|
||||
actions: [
|
||||
AnimatedDialogButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(
|
||||
loc.cancel,
|
||||
style: const TextStyle(color: CustomTheme.textColor),
|
||||
),
|
||||
),
|
||||
AnimatedDialogButton(
|
||||
CustomDialogAction(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Text(
|
||||
loc.delete,
|
||||
style: const TextStyle(
|
||||
color: CustomTheme.secondaryColor,
|
||||
),
|
||||
),
|
||||
text: loc.delete,
|
||||
),
|
||||
CustomDialogAction(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
buttonType: ButtonType.secondary,
|
||||
text: loc.cancel,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -139,9 +139,9 @@ class _MatchResultViewState extends State<MatchResultView> {
|
||||
/// based on the current selection.
|
||||
Future<void> _handleWinnerSaving() async {
|
||||
if (_selectedPlayer == null) {
|
||||
await db.scoreDao.removeWinner(matchId: widget.match.id);
|
||||
await db.scoreEntryDao.removeWinner(matchId: widget.match.id);
|
||||
} else {
|
||||
await db.scoreDao.setWinner(
|
||||
await db.scoreEntryDao.setWinner(
|
||||
matchId: widget.match.id,
|
||||
playerId: _selectedPlayer!.id,
|
||||
);
|
||||
|
||||
@@ -70,6 +70,8 @@ const allDependencies = <Package>[
|
||||
_http_parser,
|
||||
_intl,
|
||||
_io,
|
||||
_jni,
|
||||
_jni_flutter,
|
||||
_js,
|
||||
_json_annotation,
|
||||
_json_schema,
|
||||
@@ -360,13 +362,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// async 2.13.0
|
||||
/// async 2.13.1
|
||||
const _async = Package(
|
||||
name: 'async',
|
||||
description: "Utility functions and classes related to the 'dart:async' library.",
|
||||
repository: 'https://github.com/dart-lang/core/tree/main/pkgs/async',
|
||||
authors: [],
|
||||
version: '2.13.0',
|
||||
version: '2.13.1',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
@@ -442,13 +444,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// build 4.0.4
|
||||
/// build 4.0.5
|
||||
const _build = Package(
|
||||
name: 'build',
|
||||
description: 'A package for authoring build_runner compatible code generators.',
|
||||
repository: 'https://github.com/dart-lang/build/tree/master/build',
|
||||
authors: [],
|
||||
version: '4.0.4',
|
||||
version: '4.0.5',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
@@ -565,13 +567,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// build_runner 2.12.2
|
||||
/// build_runner 2.13.1
|
||||
const _build_runner = Package(
|
||||
name: 'build_runner',
|
||||
description: 'A build system for Dart code generation and modular compilation.',
|
||||
repository: 'https://github.com/dart-lang/build/tree/master/build_runner',
|
||||
authors: [],
|
||||
version: '2.12.2',
|
||||
version: '2.13.1',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
@@ -649,14 +651,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// built_value 8.12.4
|
||||
/// built_value 8.12.5
|
||||
const _built_value = Package(
|
||||
name: 'built_value',
|
||||
description: '''Value types with builders, Dart classes as enums, and serialization. This library is the runtime dependency.
|
||||
''',
|
||||
repository: 'https://github.com/google/built_value.dart/tree/master/built_value',
|
||||
authors: [],
|
||||
version: '8.12.4',
|
||||
version: '8.12.5',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
@@ -1436,18 +1438,18 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// cupertino_icons 1.0.8
|
||||
/// cupertino_icons 1.0.9
|
||||
const _cupertino_icons = Package(
|
||||
name: 'cupertino_icons',
|
||||
description: 'Default icons asset for Cupertino widgets based on Apple styled icons',
|
||||
repository: 'https://github.com/flutter/packages/tree/main/third_party/packages/cupertino_icons',
|
||||
authors: [],
|
||||
version: '1.0.8',
|
||||
version: '1.0.9',
|
||||
spdxIdentifiers: ['MIT'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
dependencies: [],
|
||||
devDependencies: [PackageRef('flutter'), PackageRef('flutter_test')],
|
||||
devDependencies: [PackageRef('collection'), PackageRef('flutter'), PackageRef('flutter_test'), PackageRef('path')],
|
||||
license: '''The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Vladimir Kharlampidi
|
||||
@@ -2627,13 +2629,13 @@ const _flutter_localizations = Package(
|
||||
devDependencies: [PackageRef('flutter_test')],
|
||||
);
|
||||
|
||||
/// flutter_plugin_android_lifecycle 2.0.33
|
||||
/// flutter_plugin_android_lifecycle 2.0.34
|
||||
const _flutter_plugin_android_lifecycle = Package(
|
||||
name: 'flutter_plugin_android_lifecycle',
|
||||
description: 'Flutter plugin for accessing an Android Lifecycle within other plugins.',
|
||||
repository: 'https://github.com/flutter/packages/tree/main/packages/flutter_plugin_android_lifecycle',
|
||||
authors: [],
|
||||
version: '2.0.33',
|
||||
version: '2.0.34',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
@@ -3173,6 +3175,88 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// jni 1.0.0
|
||||
const _jni = Package(
|
||||
name: 'jni',
|
||||
description: 'A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen.',
|
||||
repository: 'https://github.com/dart-lang/native/tree/main/pkgs/jni',
|
||||
authors: [],
|
||||
version: '1.0.0',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
dependencies: [PackageRef('args'), PackageRef('collection'), PackageRef('ffi'), PackageRef('meta'), PackageRef('package_config'), PackageRef('path'), PackageRef('plugin_platform_interface')],
|
||||
devDependencies: [PackageRef('dart_style'), PackageRef('logging'), PackageRef('test')],
|
||||
license: '''Copyright 2022, the Dart project authors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// jni_flutter 1.0.1
|
||||
const _jni_flutter = Package(
|
||||
name: 'jni_flutter',
|
||||
description: 'A library to access Flutter Android specific APIs from Dart.',
|
||||
repository: 'https://github.com/dart-lang/native/tree/main/pkgs/jni_flutter',
|
||||
authors: [],
|
||||
version: '1.0.1',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
dependencies: [PackageRef('flutter'), PackageRef('jni')],
|
||||
devDependencies: [PackageRef('flutter_test')],
|
||||
license: '''Copyright 2026, the Dart project authors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// js 0.7.2
|
||||
const _js = Package(
|
||||
name: 'js',
|
||||
@@ -3511,13 +3595,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// markdown 7.3.0
|
||||
/// markdown 7.3.1
|
||||
const _markdown = Package(
|
||||
name: 'markdown',
|
||||
description: 'A portable Markdown library written in Dart that can parse Markdown into HTML.',
|
||||
repository: 'https://github.com/dart-lang/tools/tree/main/pkgs/markdown',
|
||||
authors: [],
|
||||
version: '7.3.0',
|
||||
version: '7.3.1',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
@@ -3890,13 +3974,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// native_toolchain_c 0.17.5
|
||||
/// native_toolchain_c 0.17.6
|
||||
const _native_toolchain_c = Package(
|
||||
name: 'native_toolchain_c',
|
||||
description: 'A library to invoke the native C compiler installed on the host machine.',
|
||||
repository: 'https://github.com/dart-lang/native/tree/main/pkgs/native_toolchain_c',
|
||||
authors: [],
|
||||
version: '0.17.5',
|
||||
version: '0.17.6',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
@@ -4110,14 +4194,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// package_info_plus 9.0.0
|
||||
/// package_info_plus 9.0.1
|
||||
const _package_info_plus = Package(
|
||||
name: 'package_info_plus',
|
||||
description: 'Flutter plugin for querying information about the application package, such as CFBundleVersion on iOS or versionCode on Android.',
|
||||
homepage: 'https://github.com/fluttercommunity/plus_plugins',
|
||||
repository: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/package_info_plus/package_info_plus',
|
||||
authors: [],
|
||||
version: '9.0.0',
|
||||
version: '9.0.1',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
@@ -4194,13 +4278,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// pana 0.23.10
|
||||
/// pana 0.23.11
|
||||
const _pana = Package(
|
||||
name: 'pana',
|
||||
description: 'PAckage aNAlyzer - produce a report summarizing the health and quality of a Dart package.',
|
||||
repository: 'https://github.com/dart-lang/pana',
|
||||
authors: [],
|
||||
version: '0.23.10',
|
||||
version: '0.23.11',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
@@ -4315,17 +4399,17 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// path_provider_android 2.2.22
|
||||
/// path_provider_android 2.3.1
|
||||
const _path_provider_android = Package(
|
||||
name: 'path_provider_android',
|
||||
description: 'Android implementation of the path_provider plugin.',
|
||||
repository: 'https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_android',
|
||||
authors: [],
|
||||
version: '2.2.22',
|
||||
version: '2.3.1',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
dependencies: [PackageRef('flutter'), PackageRef('path_provider_platform_interface')],
|
||||
dependencies: [PackageRef('flutter'), PackageRef('jni'), PackageRef('jni_flutter'), PackageRef('path_provider_platform_interface')],
|
||||
devDependencies: [PackageRef('flutter_test'), PackageRef('test')],
|
||||
license: '''Copyright 2013 The Flutter Authors
|
||||
|
||||
@@ -36119,13 +36203,13 @@ Copyright (C) 2009-2017, International Business Machines Corporation,
|
||||
Google, and others. All Rights Reserved.''',
|
||||
);
|
||||
|
||||
/// source_gen 4.2.0
|
||||
/// source_gen 4.2.2
|
||||
const _source_gen = Package(
|
||||
name: 'source_gen',
|
||||
description: 'Source code generation builders and utilities for the Dart build system',
|
||||
repository: 'https://github.com/dart-lang/source_gen/tree/master/source_gen',
|
||||
authors: [],
|
||||
version: '4.2.0',
|
||||
version: '4.2.2',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
@@ -36835,13 +36919,13 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||
);
|
||||
|
||||
/// url_launcher_android 6.3.28
|
||||
/// url_launcher_android 6.3.29
|
||||
const _url_launcher_android = Package(
|
||||
name: 'url_launcher_android',
|
||||
description: 'Android implementation of the url_launcher plugin.',
|
||||
repository: 'https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_android',
|
||||
authors: [],
|
||||
version: '6.3.28',
|
||||
version: '6.3.29',
|
||||
spdxIdentifiers: ['BSD-3-Clause'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
@@ -37796,12 +37880,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.''',
|
||||
);
|
||||
|
||||
/// tallee 0.0.19+253
|
||||
/// tallee 0.0.20+254
|
||||
const _tallee = Package(
|
||||
name: 'tallee',
|
||||
description: 'Tracking App for Card Games',
|
||||
authors: [],
|
||||
version: '0.0.19+253',
|
||||
version: '0.0.20+254',
|
||||
spdxIdentifiers: ['LGPL-3.0'],
|
||||
isMarkdown: false,
|
||||
isSdk: false,
|
||||
|
||||
@@ -9,8 +9,8 @@ import 'package:tallee/core/custom_theme.dart';
|
||||
import 'package:tallee/core/enums.dart';
|
||||
import 'package:tallee/l10n/generated/app_localizations.dart';
|
||||
import 'package:tallee/presentation/views/main_menu/settings_view/licenses_view.dart';
|
||||
import 'package:tallee/presentation/widgets/buttons/animated_dialog_button.dart';
|
||||
import 'package:tallee/presentation/widgets/custom_alert_dialog.dart';
|
||||
import 'package:tallee/presentation/widgets/dialog/custom_alert_dialog.dart';
|
||||
import 'package:tallee/presentation/widgets/dialog/custom_dialog_action.dart';
|
||||
import 'package:tallee/presentation/widgets/tiles/settings_list_tile.dart';
|
||||
import 'package:tallee/services/data_transfer_service.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
@@ -122,25 +122,16 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
context: context,
|
||||
builder: (context) => CustomAlertDialog(
|
||||
title: '${loc.delete_all_data}?',
|
||||
content: loc.this_cannot_be_undone,
|
||||
content: Text(loc.this_cannot_be_undone),
|
||||
actions: [
|
||||
AnimatedDialogButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(
|
||||
loc.cancel,
|
||||
style: const TextStyle(
|
||||
color: CustomTheme.textColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
AnimatedDialogButton(
|
||||
CustomDialogAction(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Text(
|
||||
loc.delete,
|
||||
style: const TextStyle(
|
||||
color: CustomTheme.secondaryColor,
|
||||
),
|
||||
),
|
||||
text: loc.delete,
|
||||
),
|
||||
CustomDialogAction(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
buttonType: ButtonType.secondary,
|
||||
text: loc.cancel,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,22 +1,28 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tallee/core/custom_theme.dart';
|
||||
import 'package:tallee/core/enums.dart';
|
||||
|
||||
class AnimatedDialogButton extends StatefulWidget {
|
||||
/// A custom animated button widget that provides a scaling and opacity effect
|
||||
/// when pressed.
|
||||
/// - [onPressed]: Callback function that is triggered when the button is pressed.
|
||||
/// - [child]: The child widget to be displayed inside the button, typically a text or icon.
|
||||
/// - [buttonText]: The text to be displayed on the button.
|
||||
/// - [buttonType]: The type of the button, which determines its styling.
|
||||
/// - [buttonConstraints]: Optional constraints to control the button's size.
|
||||
const AnimatedDialogButton({
|
||||
super.key,
|
||||
required this.buttonText,
|
||||
required this.onPressed,
|
||||
required this.child,
|
||||
this.buttonConstraints,
|
||||
this.buttonType = ButtonType.primary,
|
||||
});
|
||||
|
||||
/// Callback function that is triggered when the button is pressed.
|
||||
final String buttonText;
|
||||
|
||||
final VoidCallback onPressed;
|
||||
|
||||
/// The child widget to be displayed inside the button, typically a text or icon.
|
||||
final Widget child;
|
||||
final BoxConstraints? buttonConstraints;
|
||||
|
||||
final ButtonType buttonType;
|
||||
|
||||
@override
|
||||
State<AnimatedDialogButton> createState() => _AnimatedDialogButtonState();
|
||||
@@ -27,6 +33,29 @@ class _AnimatedDialogButtonState extends State<AnimatedDialogButton> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textStyling = TextStyle(
|
||||
color: widget.buttonType == ButtonType.primary
|
||||
? Colors.black
|
||||
: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
);
|
||||
|
||||
final buttonDecoration = widget.buttonType == ButtonType.primary
|
||||
// Primary
|
||||
? BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
)
|
||||
: widget.buttonType == ButtonType.secondary
|
||||
// Secondary
|
||||
? BoxDecoration(
|
||||
border: BoxBorder.all(color: Colors.white, width: 2),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
)
|
||||
// Tertiary
|
||||
: const BoxDecoration();
|
||||
|
||||
return GestureDetector(
|
||||
onTapDown: (_) => setState(() => _isPressed = true),
|
||||
onTapUp: (_) => setState(() => _isPressed = false),
|
||||
@@ -38,10 +67,18 @@ class _AnimatedDialogButtonState extends State<AnimatedDialogButton> {
|
||||
child: AnimatedOpacity(
|
||||
opacity: _isPressed ? 0.6 : 1.0,
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(
|
||||
decoration: CustomTheme.standardBoxDecoration,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 26, vertical: 6),
|
||||
child: widget.child,
|
||||
child: Center(
|
||||
child: Container(
|
||||
constraints: widget.buttonConstraints,
|
||||
decoration: buttonDecoration,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
margin: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: Text(
|
||||
widget.buttonText,
|
||||
style: textStyling,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tallee/core/custom_theme.dart';
|
||||
import 'package:tallee/presentation/widgets/dialog/custom_dialog_action.dart';
|
||||
|
||||
class CustomAlertDialog extends StatelessWidget {
|
||||
/// A custom alert dialog widget that provides a os unspecific AlertDialog,
|
||||
@@ -16,20 +17,23 @@ class CustomAlertDialog extends StatelessWidget {
|
||||
});
|
||||
|
||||
final String title;
|
||||
final String content;
|
||||
final List<Widget> actions;
|
||||
final Widget content;
|
||||
final List<CustomDialogAction> actions;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(title, style: const TextStyle(color: CustomTheme.textColor)),
|
||||
content: Text(
|
||||
content,
|
||||
style: const TextStyle(color: CustomTheme.textColor),
|
||||
title: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: CustomTheme.textColor,
|
||||
),
|
||||
),
|
||||
content: content,
|
||||
actions: actions,
|
||||
backgroundColor: CustomTheme.boxColor,
|
||||
actionsAlignment: MainAxisAlignment.spaceAround,
|
||||
actionsAlignment: MainAxisAlignment.center,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: CustomTheme.standardBorderRadiusAll,
|
||||
side: const BorderSide(color: CustomTheme.boxBorderColor),
|
||||
32
lib/presentation/widgets/dialog/custom_dialog_action.dart
Normal file
32
lib/presentation/widgets/dialog/custom_dialog_action.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:tallee/core/enums.dart';
|
||||
import 'package:tallee/presentation/widgets/buttons/animated_dialog_button.dart';
|
||||
|
||||
class CustomDialogAction extends StatelessWidget {
|
||||
/// A custom dialog action widget that represents a button in a dialog.
|
||||
/// - [text]: The text to be displayed on the button.
|
||||
/// - [buttonType]: The type of the button, which determines its styling.
|
||||
/// - [onPressed]: Callback function that is triggered when the button is pressed.
|
||||
const CustomDialogAction({
|
||||
super.key,
|
||||
required this.onPressed,
|
||||
required this.text,
|
||||
this.buttonType = ButtonType.primary,
|
||||
});
|
||||
|
||||
final String text;
|
||||
|
||||
final ButtonType buttonType;
|
||||
|
||||
final VoidCallback onPressed;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AnimatedDialogButton(
|
||||
onPressed: onPressed,
|
||||
buttonText: text,
|
||||
buttonType: buttonType,
|
||||
buttonConstraints: const BoxConstraints(minWidth: 300),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
name: tallee
|
||||
description: "Tracking App for Card Games"
|
||||
publish_to: 'none'
|
||||
version: 0.0.19+253
|
||||
version: 0.0.20+254
|
||||
|
||||
environment:
|
||||
sdk: ^3.8.1
|
||||
|
||||
@@ -296,7 +296,7 @@ void main() {
|
||||
test('Setting a winner works correctly', () async {
|
||||
await database.matchDao.addMatch(match: testMatch1);
|
||||
|
||||
await database.scoreDao.setWinner(
|
||||
await database.scoreEntryDao.setWinner(
|
||||
matchId: testMatch1.id,
|
||||
playerId: testPlayer5.id,
|
||||
);
|
||||
|
||||
@@ -70,13 +70,13 @@ void main() {
|
||||
group('Adding and Fetching scores', () {
|
||||
test('Single Score', () async {
|
||||
ScoreEntry entry = ScoreEntry(roundNumber: 1, score: 10, change: 10);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: entry,
|
||||
);
|
||||
|
||||
final score = await database.scoreDao.getScore(
|
||||
final score = await database.scoreEntryDao.getScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
roundNumber: 1,
|
||||
@@ -95,13 +95,13 @@ void main() {
|
||||
ScoreEntry(roundNumber: 3, score: 18, change: 6),
|
||||
];
|
||||
|
||||
await database.scoreDao.addScoresAsList(
|
||||
await database.scoreEntryDao.addScoresAsList(
|
||||
entrys: entryList,
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
final scores = await database.scoreDao.getAllPlayerScoresInMatch(
|
||||
final scores = await database.scoreEntryDao.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
@@ -120,13 +120,13 @@ void main() {
|
||||
group('Undesirable values', () {
|
||||
test('Score & Round can have negative values', () async {
|
||||
ScoreEntry entry = ScoreEntry(roundNumber: -2, score: -10, change: -10);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: entry,
|
||||
);
|
||||
|
||||
final score = await database.scoreDao.getScore(
|
||||
final score = await database.scoreEntryDao.getScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
roundNumber: -2,
|
||||
@@ -140,13 +140,13 @@ void main() {
|
||||
|
||||
test('Score & Round can have zero values', () async {
|
||||
ScoreEntry entry = ScoreEntry(roundNumber: 0, score: 0, change: 0);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: entry,
|
||||
);
|
||||
|
||||
final score = await database.scoreDao.getScore(
|
||||
final score = await database.scoreEntryDao.getScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
roundNumber: 0,
|
||||
@@ -158,7 +158,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('Getting score for a non-existent entities returns null', () async {
|
||||
var score = await database.scoreDao.getScore(
|
||||
var score = await database.scoreEntryDao.getScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
roundNumber: -1,
|
||||
@@ -166,14 +166,14 @@ void main() {
|
||||
|
||||
expect(score, isNull);
|
||||
|
||||
score = await database.scoreDao.getScore(
|
||||
score = await database.scoreEntryDao.getScore(
|
||||
playerId: 'non-existin-player',
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
expect(score, isNull);
|
||||
|
||||
score = await database.scoreDao.getScore(
|
||||
score = await database.scoreEntryDao.getScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: 'non-existing-match',
|
||||
);
|
||||
@@ -183,19 +183,19 @@ void main() {
|
||||
|
||||
test('Getting score for a non-match player returns null', () async {
|
||||
ScoreEntry entry = ScoreEntry(roundNumber: 1, score: 10, change: 10);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: entry,
|
||||
);
|
||||
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer3.id,
|
||||
matchId: testMatch2.id,
|
||||
entry: entry,
|
||||
);
|
||||
|
||||
var score = await database.scoreDao.getScore(
|
||||
var score = await database.scoreEntryDao.getScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch2.id,
|
||||
roundNumber: 1,
|
||||
@@ -210,23 +210,23 @@ void main() {
|
||||
ScoreEntry entry1 = ScoreEntry(roundNumber: 1, score: 10, change: 10);
|
||||
ScoreEntry entry2 = ScoreEntry(roundNumber: 1, score: 20, change: 20);
|
||||
ScoreEntry entry3 = ScoreEntry(roundNumber: 2, score: 25, change: 15);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: entry1,
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer2.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: entry2,
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: entry3,
|
||||
);
|
||||
|
||||
final scores = await database.scoreDao.getAllMatchScores(
|
||||
final scores = await database.scoreEntryDao.getAllMatchScores(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
@@ -236,7 +236,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('getAllMatchScores() with no scores saved', () async {
|
||||
final scores = await database.scoreDao.getAllMatchScores(
|
||||
final scores = await database.scoreEntryDao.getAllMatchScores(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
@@ -247,21 +247,22 @@ void main() {
|
||||
ScoreEntry entry1 = ScoreEntry(roundNumber: 1, score: 10, change: 10);
|
||||
ScoreEntry entry2 = ScoreEntry(roundNumber: 2, score: 25, change: 15);
|
||||
ScoreEntry entry3 = ScoreEntry(roundNumber: 1, score: 30, change: 30);
|
||||
await database.scoreDao.addScoresAsList(
|
||||
await database.scoreEntryDao.addScoresAsList(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entrys: [entry1, entry2],
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer2.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: entry3,
|
||||
);
|
||||
|
||||
final playerScores = await database.scoreDao.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
final playerScores = await database.scoreEntryDao
|
||||
.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
expect(playerScores.length, 2);
|
||||
expect(playerScores[0].roundNumber, 1);
|
||||
@@ -273,10 +274,11 @@ void main() {
|
||||
});
|
||||
|
||||
test('getAllPlayerScoresInMatch() with no scores saved', () async {
|
||||
final playerScores = await database.scoreDao.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
final playerScores = await database.scoreEntryDao
|
||||
.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
expect(playerScores.isEmpty, true);
|
||||
});
|
||||
@@ -284,30 +286,32 @@ void main() {
|
||||
test('Scores are isolated across different matches', () async {
|
||||
ScoreEntry entry1 = ScoreEntry(roundNumber: 1, score: 10, change: 10);
|
||||
ScoreEntry entry2 = ScoreEntry(roundNumber: 1, score: 50, change: 50);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: entry1,
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch2.id,
|
||||
entry: entry2,
|
||||
);
|
||||
|
||||
final match1Scores = await database.scoreDao.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
final match1Scores = await database.scoreEntryDao
|
||||
.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
expect(match1Scores.length, 1);
|
||||
expect(match1Scores[0].score, 10);
|
||||
expect(match1Scores[0].change, 10);
|
||||
|
||||
final match2Scores = await database.scoreDao.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch2.id,
|
||||
);
|
||||
final match2Scores = await database.scoreEntryDao
|
||||
.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch2.id,
|
||||
);
|
||||
|
||||
expect(match2Scores.length, 1);
|
||||
expect(match2Scores[0].score, 50);
|
||||
@@ -319,19 +323,19 @@ void main() {
|
||||
test('updateScore()', () async {
|
||||
ScoreEntry entry1 = ScoreEntry(roundNumber: 1, score: 10, change: 10);
|
||||
ScoreEntry entry2 = ScoreEntry(roundNumber: 2, score: 15, change: 5);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: entry1,
|
||||
);
|
||||
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: entry2,
|
||||
);
|
||||
|
||||
final updated = await database.scoreDao.updateScore(
|
||||
final updated = await database.scoreEntryDao.updateScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
newEntry: ScoreEntry(roundNumber: 2, score: 50, change: 40),
|
||||
@@ -339,7 +343,7 @@ void main() {
|
||||
|
||||
expect(updated, true);
|
||||
|
||||
final score = await database.scoreDao.getScore(
|
||||
final score = await database.scoreEntryDao.getScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
roundNumber: 2,
|
||||
@@ -351,7 +355,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('Updating a non-existent score returns false', () async {
|
||||
final updated = await database.scoreDao.updateScore(
|
||||
final updated = await database.scoreEntryDao.updateScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
newEntry: ScoreEntry(roundNumber: 1, score: 20, change: 20),
|
||||
@@ -363,13 +367,13 @@ void main() {
|
||||
|
||||
group('Deleting scores', () {
|
||||
test('deleteScore() ', () async {
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 1, score: 10, change: 10),
|
||||
);
|
||||
|
||||
final deleted = await database.scoreDao.deleteScore(
|
||||
final deleted = await database.scoreEntryDao.deleteScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
roundNumber: 1,
|
||||
@@ -377,7 +381,7 @@ void main() {
|
||||
|
||||
expect(deleted, true);
|
||||
|
||||
final score = await database.scoreDao.getScore(
|
||||
final score = await database.scoreEntryDao.getScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
roundNumber: 1,
|
||||
@@ -387,7 +391,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('Deleting a non-existent score returns false', () async {
|
||||
final deleted = await database.scoreDao.deleteScore(
|
||||
final deleted = await database.scoreEntryDao.deleteScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
roundNumber: 1,
|
||||
@@ -397,127 +401,130 @@ void main() {
|
||||
});
|
||||
|
||||
test('deleteAllScoresForMatch() works correctly', () async {
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 1, score: 10, change: 10),
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer2.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 1, score: 20, change: 20),
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch2.id,
|
||||
entry: ScoreEntry(roundNumber: 1, score: 15, change: 15),
|
||||
);
|
||||
|
||||
final deleted = await database.scoreDao.deleteAllScoresForMatch(
|
||||
final deleted = await database.scoreEntryDao.deleteAllScoresForMatch(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
expect(deleted, true);
|
||||
|
||||
final match1Scores = await database.scoreDao.getAllMatchScores(
|
||||
final match1Scores = await database.scoreEntryDao.getAllMatchScores(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(match1Scores.length, 0);
|
||||
|
||||
final match2Scores = await database.scoreDao.getAllMatchScores(
|
||||
final match2Scores = await database.scoreEntryDao.getAllMatchScores(
|
||||
matchId: testMatch2.id,
|
||||
);
|
||||
expect(match2Scores.length, 1);
|
||||
});
|
||||
|
||||
test('deleteAllScoresForPlayerInMatch() works correctly', () async {
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 1, score: 10, change: 10),
|
||||
);
|
||||
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 2, score: 15, change: 5),
|
||||
);
|
||||
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer2.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 1, score: 6, change: 6),
|
||||
);
|
||||
|
||||
final deleted = await database.scoreDao.deleteAllScoresForPlayerInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
final deleted = await database.scoreEntryDao
|
||||
.deleteAllScoresForPlayerInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
expect(deleted, true);
|
||||
|
||||
final player1Scores = await database.scoreDao.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
final player1Scores = await database.scoreEntryDao
|
||||
.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(player1Scores.length, 0);
|
||||
|
||||
final player2Scores = await database.scoreDao.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer2.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
final player2Scores = await database.scoreEntryDao
|
||||
.getAllPlayerScoresInMatch(
|
||||
playerId: testPlayer2.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(player2Scores.length, 1);
|
||||
});
|
||||
});
|
||||
|
||||
group('Score Aggregations & Edge Cases', () {
|
||||
test('getLatestRoundNumber()', () async {
|
||||
var latestRound = await database.scoreDao.getLatestRoundNumber(
|
||||
var latestRound = await database.scoreEntryDao.getLatestRoundNumber(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(latestRound, isNull);
|
||||
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 1, score: 10, change: 10),
|
||||
);
|
||||
|
||||
latestRound = await database.scoreDao.getLatestRoundNumber(
|
||||
latestRound = await database.scoreEntryDao.getLatestRoundNumber(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(latestRound, 1);
|
||||
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 5, score: 50, change: 40),
|
||||
);
|
||||
|
||||
latestRound = await database.scoreDao.getLatestRoundNumber(
|
||||
latestRound = await database.scoreEntryDao.getLatestRoundNumber(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(latestRound, 5);
|
||||
});
|
||||
|
||||
test('getLatestRoundNumber() with non-consecutive rounds', () async {
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 1, score: 10, change: 10),
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 5, score: 50, change: 40),
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 3, score: 30, change: 20),
|
||||
);
|
||||
|
||||
final latestRound = await database.scoreDao.getLatestRoundNumber(
|
||||
final latestRound = await database.scoreEntryDao.getLatestRoundNumber(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
@@ -525,29 +532,29 @@ void main() {
|
||||
});
|
||||
|
||||
test('getTotalScoreForPlayer()', () async {
|
||||
var totalScore = await database.scoreDao.getTotalScoreForPlayer(
|
||||
var totalScore = await database.scoreEntryDao.getTotalScoreForPlayer(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(totalScore, 0);
|
||||
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 1, score: 10, change: 10),
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 2, score: 25, change: 15),
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 3, score: 40, change: 15),
|
||||
);
|
||||
|
||||
totalScore = await database.scoreDao.getTotalScoreForPlayer(
|
||||
totalScore = await database.scoreEntryDao.getTotalScoreForPlayer(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
@@ -555,23 +562,23 @@ void main() {
|
||||
});
|
||||
|
||||
test('getTotalScoreForPlayer() ignores round score', () async {
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 2, score: 25, change: 25),
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 1, score: 25, change: 10),
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 3, score: 25, change: 25),
|
||||
);
|
||||
|
||||
final totalScore = await database.scoreDao.getTotalScoreForPlayer(
|
||||
final totalScore = await database.scoreEntryDao.getTotalScoreForPlayer(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
@@ -581,18 +588,18 @@ void main() {
|
||||
});
|
||||
|
||||
test('Adding the same score twice replaces the existing one', () async {
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 1, score: 10, change: 10),
|
||||
);
|
||||
await database.scoreDao.addScore(
|
||||
await database.scoreEntryDao.addScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
entry: ScoreEntry(roundNumber: 1, score: 20, change: 20),
|
||||
);
|
||||
|
||||
final score = await database.scoreDao.getScore(
|
||||
final score = await database.scoreEntryDao.getScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
roundNumber: 1,
|
||||
@@ -606,100 +613,116 @@ void main() {
|
||||
|
||||
group('Handling Winner', () {
|
||||
test('hasWinner() works correctly', () async {
|
||||
var hasWinner = await database.scoreDao.hasWinner(
|
||||
var hasWinner = await database.scoreEntryDao.hasWinner(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(hasWinner, false);
|
||||
|
||||
await database.scoreDao.setWinner(
|
||||
await database.scoreEntryDao.setWinner(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
hasWinner = await database.scoreDao.hasWinner(matchId: testMatch1.id);
|
||||
hasWinner = await database.scoreEntryDao.hasWinner(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(hasWinner, true);
|
||||
});
|
||||
|
||||
test('getWinnersForMatch() returns correct winner', () async {
|
||||
var winner = await database.scoreDao.getWinner(matchId: testMatch1.id);
|
||||
var winner = await database.scoreEntryDao.getWinner(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(winner, isNull);
|
||||
|
||||
await database.scoreDao.setWinner(
|
||||
await database.scoreEntryDao.setWinner(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
winner = await database.scoreDao.getWinner(matchId: testMatch1.id);
|
||||
winner = await database.scoreEntryDao.getWinner(matchId: testMatch1.id);
|
||||
|
||||
expect(winner, isNotNull);
|
||||
expect(winner!.id, testPlayer1.id);
|
||||
});
|
||||
|
||||
test('removeWinner() works correctly', () async {
|
||||
var removed = await database.scoreDao.removeWinner(
|
||||
var removed = await database.scoreEntryDao.removeWinner(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(removed, false);
|
||||
|
||||
await database.scoreDao.setWinner(
|
||||
await database.scoreEntryDao.setWinner(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
removed = await database.scoreDao.removeWinner(matchId: testMatch1.id);
|
||||
removed = await database.scoreEntryDao.removeWinner(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(removed, true);
|
||||
|
||||
var winner = await database.scoreDao.getWinner(matchId: testMatch1.id);
|
||||
var winner = await database.scoreEntryDao.getWinner(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(winner, isNull);
|
||||
});
|
||||
});
|
||||
|
||||
group('Handling Looser', () {
|
||||
test('hasLooser() works correctly', () async {
|
||||
var hasLooser = await database.scoreDao.hasLooser(
|
||||
var hasLooser = await database.scoreEntryDao.hasLooser(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(hasLooser, false);
|
||||
|
||||
await database.scoreDao.setLooser(
|
||||
await database.scoreEntryDao.setLooser(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
hasLooser = await database.scoreDao.hasLooser(matchId: testMatch1.id);
|
||||
hasLooser = await database.scoreEntryDao.hasLooser(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(hasLooser, true);
|
||||
});
|
||||
|
||||
test('getLooser() returns correct winner', () async {
|
||||
var looser = await database.scoreDao.getLooser(matchId: testMatch1.id);
|
||||
var looser = await database.scoreEntryDao.getLooser(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(looser, isNull);
|
||||
|
||||
await database.scoreDao.setLooser(
|
||||
await database.scoreEntryDao.setLooser(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
looser = await database.scoreDao.getLooser(matchId: testMatch1.id);
|
||||
looser = await database.scoreEntryDao.getLooser(matchId: testMatch1.id);
|
||||
|
||||
expect(looser, isNotNull);
|
||||
expect(looser!.id, testPlayer1.id);
|
||||
});
|
||||
|
||||
test('removeLooser() works correctly', () async {
|
||||
var removed = await database.scoreDao.removeLooser(
|
||||
var removed = await database.scoreEntryDao.removeLooser(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(removed, false);
|
||||
|
||||
await database.scoreDao.setLooser(
|
||||
await database.scoreEntryDao.setLooser(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
|
||||
removed = await database.scoreDao.removeLooser(matchId: testMatch1.id);
|
||||
removed = await database.scoreEntryDao.removeLooser(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(removed, true);
|
||||
|
||||
var looser = await database.scoreDao.getLooser(matchId: testMatch1.id);
|
||||
var looser = await database.scoreEntryDao.getLooser(
|
||||
matchId: testMatch1.id,
|
||||
);
|
||||
expect(looser, isNull);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user