Removed unnecessary declared attributes
This commit is contained in:
@@ -148,7 +148,7 @@ class _CreateGroupViewState extends State<CreateGroupView> {
|
|||||||
final groupName = _groupNameController.text.trim();
|
final groupName = _groupNameController.text.trim();
|
||||||
|
|
||||||
final success = await db.groupDao.addGroup(
|
final success = await db.groupDao.addGroup(
|
||||||
group: Group(name: groupName, description: '', members: selectedPlayers),
|
group: Group(name: groupName, members: selectedPlayers),
|
||||||
);
|
);
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class _GroupViewState extends State<GroupView> {
|
|||||||
Group(
|
Group(
|
||||||
name: 'Skeleton Group',
|
name: 'Skeleton Group',
|
||||||
description: '',
|
description: '',
|
||||||
members: List.filled(6, Player(name: 'Skeleton Player', description: '')),
|
members: List.filled(6, Player(name: 'Skeleton Player')),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -167,8 +167,7 @@ class _StatisticsViewState extends State<StatisticsView> {
|
|||||||
final playerId = winCounts[i].$1;
|
final playerId = winCounts[i].$1;
|
||||||
final player = players.firstWhere(
|
final player = players.firstWhere(
|
||||||
(p) => p.id == playerId,
|
(p) => p.id == playerId,
|
||||||
orElse: () =>
|
orElse: () => Player(id: playerId, name: loc.not_available),
|
||||||
Player(id: playerId, name: loc.not_available, description: ''),
|
|
||||||
);
|
);
|
||||||
winCounts[i] = (player.name, winCounts[i].$2);
|
winCounts[i] = (player.name, winCounts[i].$2);
|
||||||
}
|
}
|
||||||
@@ -230,8 +229,7 @@ class _StatisticsViewState extends State<StatisticsView> {
|
|||||||
final playerId = matchCounts[i].$1;
|
final playerId = matchCounts[i].$1;
|
||||||
final player = players.firstWhere(
|
final player = players.firstWhere(
|
||||||
(p) => p.id == playerId,
|
(p) => p.id == playerId,
|
||||||
orElse: () =>
|
orElse: () => Player(id: playerId, name: loc.not_available),
|
||||||
Player(id: playerId, name: loc.not_available, description: ''),
|
|
||||||
);
|
);
|
||||||
matchCounts[i] = (player.name, matchCounts[i].$2);
|
matchCounts[i] = (player.name, matchCounts[i].$2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class _PlayerSelectionState extends State<PlayerSelection> {
|
|||||||
/// Skeleton data used while loading players.
|
/// Skeleton data used while loading players.
|
||||||
late final List<Player> skeletonData = List.filled(
|
late final List<Player> skeletonData = List.filled(
|
||||||
7,
|
7,
|
||||||
Player(name: 'Player 0', description: ''),
|
Player(name: 'Player 0'),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -282,7 +282,7 @@ class _PlayerSelectionState extends State<PlayerSelection> {
|
|||||||
final loc = AppLocalizations.of(context);
|
final loc = AppLocalizations.of(context);
|
||||||
final playerName = _searchBarController.text.trim();
|
final playerName = _searchBarController.text.trim();
|
||||||
|
|
||||||
final createdPlayer = Player(name: playerName, description: '');
|
final createdPlayer = Player(name: playerName);
|
||||||
final success = await db.playerDao.addPlayer(player: createdPlayer);
|
final success = await db.playerDao.addPlayer(player: createdPlayer);
|
||||||
|
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ void main() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
withClock(fakeClock, () {
|
withClock(fakeClock, () {
|
||||||
testPlayer1 = Player(name: 'Alice', description: '');
|
testPlayer1 = Player(name: 'Alice');
|
||||||
testPlayer2 = Player(name: 'Bob', description: '');
|
testPlayer2 = Player(name: 'Bob');
|
||||||
testPlayer3 = Player(name: 'Charlie', description: '');
|
testPlayer3 = Player(name: 'Charlie');
|
||||||
testPlayer4 = Player(name: 'Diana', description: '');
|
testPlayer4 = Player(name: 'Diana');
|
||||||
testGroup1 = Group(
|
testGroup1 = Group(
|
||||||
name: 'Test Group',
|
name: 'Test Group',
|
||||||
description: '',
|
description: '',
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ void main() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
withClock(fakeClock, () {
|
withClock(fakeClock, () {
|
||||||
testPlayer1 = Player(name: 'Alice', description: '');
|
testPlayer1 = Player(name: 'Alice');
|
||||||
testPlayer2 = Player(name: 'Bob', description: '');
|
testPlayer2 = Player(name: 'Bob');
|
||||||
testPlayer3 = Player(name: 'Charlie', description: '');
|
testPlayer3 = Player(name: 'Charlie');
|
||||||
testPlayer4 = Player(name: 'Diana', description: '');
|
testPlayer4 = Player(name: 'Diana');
|
||||||
testPlayer5 = Player(name: 'Eve', description: '');
|
testPlayer5 = Player(name: 'Eve');
|
||||||
testGroup1 = Group(
|
testGroup1 = Group(
|
||||||
name: 'Test Group 1',
|
name: 'Test Group 1',
|
||||||
description: '',
|
description: '',
|
||||||
@@ -62,28 +62,24 @@ void main() {
|
|||||||
name: 'First Test Match',
|
name: 'First Test Match',
|
||||||
game: testGame,
|
game: testGame,
|
||||||
group: testGroup1,
|
group: testGroup1,
|
||||||
players: [testPlayer4, testPlayer5],
|
players: [testPlayer4, testPlayer5]
|
||||||
notes: '',
|
|
||||||
);
|
);
|
||||||
testMatch2 = Match(
|
testMatch2 = Match(
|
||||||
name: 'Second Test Match',
|
name: 'Second Test Match',
|
||||||
game: testGame,
|
game: testGame,
|
||||||
group: testGroup2,
|
group: testGroup2,
|
||||||
players: [testPlayer1, testPlayer2, testPlayer3],
|
players: [testPlayer1, testPlayer2, testPlayer3]
|
||||||
notes: '',
|
|
||||||
);
|
);
|
||||||
testMatchOnlyPlayers = Match(
|
testMatchOnlyPlayers = Match(
|
||||||
name: 'Test Match with Players',
|
name: 'Test Match with Players',
|
||||||
game: testGame,
|
game: testGame,
|
||||||
players: [testPlayer1, testPlayer2, testPlayer3],
|
players: [testPlayer1, testPlayer2, testPlayer3]
|
||||||
notes: '',
|
|
||||||
);
|
);
|
||||||
testMatchOnlyGroup = Match(
|
testMatchOnlyGroup = Match(
|
||||||
name: 'Test Match with Group',
|
name: 'Test Match with Group',
|
||||||
game: testGame,
|
game: testGame,
|
||||||
group: testGroup2,
|
group: testGroup2,
|
||||||
players: testGroup2.members,
|
players: testGroup2.members
|
||||||
notes: '',
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
await database.playerDao.addPlayersAsList(
|
await database.playerDao.addPlayersAsList(
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ void main() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
withClock(fakeClock, () {
|
withClock(fakeClock, () {
|
||||||
testPlayer1 = Player(name: 'Alice', description: '');
|
testPlayer1 = Player(name: 'Alice');
|
||||||
testPlayer2 = Player(name: 'Bob', description: '');
|
testPlayer2 = Player(name: 'Bob');
|
||||||
testPlayer3 = Player(name: 'Charlie', description: '');
|
testPlayer3 = Player(name: 'Charlie');
|
||||||
testPlayer4 = Player(name: 'Diana', description: '');
|
testPlayer4 = Player(name: 'Diana');
|
||||||
testTeam1 = Team(name: 'Team Alpha', members: [testPlayer1, testPlayer2]);
|
testTeam1 = Team(name: 'Team Alpha', members: [testPlayer1, testPlayer2]);
|
||||||
testTeam2 = Team(name: 'Team Beta', members: [testPlayer3, testPlayer4]);
|
testTeam2 = Team(name: 'Team Beta', members: [testPlayer3, testPlayer4]);
|
||||||
testTeam3 = Team(name: 'Team Gamma', members: [testPlayer1, testPlayer3]);
|
testTeam3 = Team(name: 'Team Gamma', members: [testPlayer1, testPlayer3]);
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ void main() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
withClock(fakeClock, () {
|
withClock(fakeClock, () {
|
||||||
testPlayer1 = Player(name: 'Test Player', description: '');
|
testPlayer1 = Player(name: 'Test Player');
|
||||||
testPlayer2 = Player(name: 'Second Player', description: '');
|
testPlayer2 = Player(name: 'Second Player');
|
||||||
testPlayer3 = Player(name: 'Charlie', description: '');
|
testPlayer3 = Player(name: 'Charlie');
|
||||||
testPlayer4 = Player(name: 'Diana', description: '');
|
testPlayer4 = Player(name: 'Diana');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
tearDown(() async {
|
tearDown(() async {
|
||||||
@@ -348,7 +348,7 @@ void main() {
|
|||||||
|
|
||||||
// Verifies that a player with empty string name is stored correctly.
|
// Verifies that a player with empty string name is stored correctly.
|
||||||
test('Player with empty string name is stored correctly', () async {
|
test('Player with empty string name is stored correctly', () async {
|
||||||
final emptyNamePlayer = Player(name: '', description: '');
|
final emptyNamePlayer = Player(name: '');
|
||||||
|
|
||||||
await database.playerDao.addPlayer(player: emptyNamePlayer);
|
await database.playerDao.addPlayer(player: emptyNamePlayer);
|
||||||
|
|
||||||
@@ -361,7 +361,7 @@ void main() {
|
|||||||
// Verifies that a player with very long name is stored correctly.
|
// Verifies that a player with very long name is stored correctly.
|
||||||
test('Player with very long name is stored correctly', () async {
|
test('Player with very long name is stored correctly', () async {
|
||||||
final longName = 'A' * 1000;
|
final longName = 'A' * 1000;
|
||||||
final longNamePlayer = Player(name: longName, description: '');
|
final longNamePlayer = Player(name: longName);
|
||||||
|
|
||||||
await database.playerDao.addPlayer(player: longNamePlayer);
|
await database.playerDao.addPlayer(player: longNamePlayer);
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ void main() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
withClock(fakeClock, () {
|
withClock(fakeClock, () {
|
||||||
testPlayer1 = Player(name: 'Alice', description: '');
|
testPlayer1 = Player(name: 'Alice');
|
||||||
testPlayer2 = Player(name: 'Bob', description: '');
|
testPlayer2 = Player(name: 'Bob');
|
||||||
testPlayer3 = Player(name: 'Charlie', description: '');
|
testPlayer3 = Player(name: 'Charlie');
|
||||||
testPlayer4 = Player(name: 'Diana', description: '');
|
testPlayer4 = Player(name: 'Diana');
|
||||||
testGroup = Group(
|
testGroup = Group(
|
||||||
name: 'Test Group',
|
name: 'Test Group',
|
||||||
description: '',
|
description: '',
|
||||||
|
|||||||
@@ -37,12 +37,12 @@ void main() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
withClock(fakeClock, () {
|
withClock(fakeClock, () {
|
||||||
testPlayer1 = Player(name: 'Alice', description: '');
|
testPlayer1 = Player(name: 'Alice');
|
||||||
testPlayer2 = Player(name: 'Bob', description: '');
|
testPlayer2 = Player(name: 'Bob');
|
||||||
testPlayer3 = Player(name: 'Charlie', description: '');
|
testPlayer3 = Player(name: 'Charlie');
|
||||||
testPlayer4 = Player(name: 'Diana', description: '');
|
testPlayer4 = Player(name: 'Diana');
|
||||||
testPlayer5 = Player(name: 'Eve', description: '');
|
testPlayer5 = Player(name: 'Eve');
|
||||||
testPlayer6 = Player(name: 'Frank', description: '');
|
testPlayer6 = Player(name: 'Frank');
|
||||||
testGroup = Group(
|
testGroup = Group(
|
||||||
name: 'Test Group',
|
name: 'Test Group',
|
||||||
description: '',
|
description: '',
|
||||||
@@ -59,14 +59,12 @@ void main() {
|
|||||||
name: 'Test Match with Group',
|
name: 'Test Match with Group',
|
||||||
game: testGame,
|
game: testGame,
|
||||||
players: testGroup.members,
|
players: testGroup.members,
|
||||||
group: testGroup,
|
group: testGroup
|
||||||
notes: '',
|
|
||||||
);
|
);
|
||||||
testMatchOnlyPlayers = Match(
|
testMatchOnlyPlayers = Match(
|
||||||
name: 'Test Match with Players',
|
name: 'Test Match with Players',
|
||||||
game: testGame,
|
game: testGame,
|
||||||
players: [testPlayer4, testPlayer5, testPlayer6],
|
players: [testPlayer4, testPlayer5, testPlayer6]
|
||||||
notes: '',
|
|
||||||
);
|
);
|
||||||
testTeam1 = Team(name: 'Team Alpha', members: [testPlayer1, testPlayer2]);
|
testTeam1 = Team(name: 'Team Alpha', members: [testPlayer1, testPlayer2]);
|
||||||
testTeam2 = Team(name: 'Team Beta', members: [testPlayer3, testPlayer4]);
|
testTeam2 = Team(name: 'Team Beta', members: [testPlayer3, testPlayer4]);
|
||||||
@@ -568,14 +566,12 @@ void main() {
|
|||||||
final match1 = Match(
|
final match1 = Match(
|
||||||
name: 'Match 1',
|
name: 'Match 1',
|
||||||
game: testGame,
|
game: testGame,
|
||||||
players: playersList,
|
players: playersList
|
||||||
notes: '',
|
|
||||||
);
|
);
|
||||||
final match2 = Match(
|
final match2 = Match(
|
||||||
name: 'Match 2',
|
name: 'Match 2',
|
||||||
game: testGame,
|
game: testGame,
|
||||||
players: playersList,
|
players: playersList
|
||||||
notes: '',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
await Future.wait([
|
await Future.wait([
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ void main() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
withClock(fakeClock, () {
|
withClock(fakeClock, () {
|
||||||
testPlayer1 = Player(name: 'Alice', description: '');
|
testPlayer1 = Player(name: 'Alice');
|
||||||
testPlayer2 = Player(name: 'Bob', description: '');
|
testPlayer2 = Player(name: 'Bob');
|
||||||
testPlayer3 = Player(name: 'Charlie', description: '');
|
testPlayer3 = Player(name: 'Charlie');
|
||||||
testGame = Game(
|
testGame = Game(
|
||||||
name: 'Test Game',
|
name: 'Test Game',
|
||||||
ruleset: Ruleset.singleWinner,
|
ruleset: Ruleset.singleWinner,
|
||||||
@@ -44,13 +44,11 @@ void main() {
|
|||||||
name: 'Test Match 1',
|
name: 'Test Match 1',
|
||||||
game: testGame,
|
game: testGame,
|
||||||
players: [testPlayer1, testPlayer2],
|
players: [testPlayer1, testPlayer2],
|
||||||
notes: '',
|
|
||||||
);
|
);
|
||||||
testMatch2 = Match(
|
testMatch2 = Match(
|
||||||
name: 'Test Match 2',
|
name: 'Test Match 2',
|
||||||
game: testGame,
|
game: testGame,
|
||||||
players: [testPlayer2, testPlayer3],
|
players: [testPlayer2, testPlayer3],
|
||||||
notes: '',
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user