HomeView Mock-Daten entfernen #51

Merged
sneeex merged 7 commits from enhancement/46-homeview-mockdaten-entfernen into development 2025-11-23 18:19:54 +00:00
5 changed files with 12 additions and 5 deletions
Showing only changes of commit 22d95b0015 - Show all commits

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,