Merge remote-tracking branch 'origin/development' into enhancement/46-homeview-mockdaten-entfernen
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m9s
Pull Request Pipeline / lint (pull_request) Successful in 2m11s

# Conflicts:
#	lib/presentation/views/main_menu/home_view.dart
This commit is contained in:
2025-11-23 19:04:02 +01:00
5 changed files with 12 additions and 5 deletions

View File

@@ -54,7 +54,11 @@ class _CreateGroupViewState extends State<CreateGroupView> {
}
void loadPlayerList() {
_allPlayersFuture = db.playerDao.getAllPlayers();
_allPlayersFuture = Future.delayed(
const Duration(milliseconds: 250),
() => db.playerDao.getAllPlayers(),
);
suggestedPlayers = skeletonData;
_allPlayersFuture.then((loadedPlayers) {
setState(() {
loadedPlayers.sort((a, b) => a.name.compareTo(b.name));

View File

@@ -34,7 +34,10 @@ class _GroupsViewState extends State<GroupsView> {
void initState() {
super.initState();
db = Provider.of<AppDatabase>(context, listen: false);
_allGroupsFuture = db.groupDao.getAllGroups();
_allGroupsFuture = Future.delayed(
const Duration(milliseconds: 250),
() => db.groupDao.getAllGroups(),
);
}
@override

View File

@@ -48,7 +48,7 @@ class _HomeViewState extends State<HomeView> {
Future.wait([_gameCountFuture, _groupCountFuture, _recentGamesFuture]).then(
(_) async {
await Future.delayed(const Duration(milliseconds: 50));
await Future.delayed(const Duration(milliseconds: 250));
if (mounted) {
setState(() {
isLoading = false;

View File

@@ -29,7 +29,7 @@ class _StatisticsViewState extends State<StatisticsView> {
_playersFuture = db.playerDao.getAllPlayers();
Future.wait([_gamesFuture, _playersFuture]).then((results) async {
await Future.delayed(const Duration(milliseconds: 200));
await Future.delayed(const Duration(milliseconds: 250));
final games = results[0] as List<Game>;
final players = results[1] as List<Player>;
winCounts = _calculateWinsForAllPlayers(games, players);

View File

@@ -80,7 +80,7 @@ class StatisticsTile extends StatelessWidget {
const Spacer(),
Center(
child: Text(
values[index].$2 <= 1
values[index].$2 <= 1 && values[index].$2 is double
? values[index].$2.toStringAsFixed(2)
: values[index].$2.toString(),
textAlign: TextAlign.center,