MVP #141

Merged
flixcoo merged 705 commits from development into main 2026-01-09 12:55:50 +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() { void loadPlayerList() {
_allPlayersFuture = db.playerDao.getAllPlayers(); _allPlayersFuture = Future.delayed(
const Duration(milliseconds: 250),
() => db.playerDao.getAllPlayers(),
);
suggestedPlayers = skeletonData;
_allPlayersFuture.then((loadedPlayers) { _allPlayersFuture.then((loadedPlayers) {
setState(() { setState(() {
loadedPlayers.sort((a, b) => a.name.compareTo(b.name)); loadedPlayers.sort((a, b) => a.name.compareTo(b.name));

View File

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

View File

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

View File

@@ -29,7 +29,7 @@ class _StatisticsViewState extends State<StatisticsView> {
_playersFuture = db.playerDao.getAllPlayers(); _playersFuture = db.playerDao.getAllPlayers();
Future.wait([_gamesFuture, _playersFuture]).then((results) async { 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 games = results[0] as List<Game>;
final players = results[1] as List<Player>; final players = results[1] as List<Player>;
winCounts = _calculateWinsForAllPlayers(games, players); winCounts = _calculateWinsForAllPlayers(games, players);

View File

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