Bei 0 gespielten Matches keine Stats anzeigen #111
@@ -5,6 +5,7 @@ import 'package:game_tracker/data/dto/match.dart';
|
|||||||
import 'package:game_tracker/data/dto/player.dart';
|
import 'package:game_tracker/data/dto/player.dart';
|
||||||
import 'package:game_tracker/presentation/widgets/app_skeleton.dart';
|
import 'package:game_tracker/presentation/widgets/app_skeleton.dart';
|
||||||
import 'package:game_tracker/presentation/widgets/tiles/statistics_tile.dart';
|
import 'package:game_tracker/presentation/widgets/tiles/statistics_tile.dart';
|
||||||
|
import 'package:game_tracker/presentation/widgets/top_centered_message.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class StatisticsView extends StatefulWidget {
|
class StatisticsView extends StatefulWidget {
|
||||||
@@ -58,6 +59,13 @@ class _StatisticsViewState extends State<StatisticsView> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: constraints.maxHeight * 0.01),
|
SizedBox(height: constraints.maxHeight * 0.01),
|
||||||
|
Visibility(
|
||||||
|
visible:
|
||||||
|
winCounts.isEmpty &&
|
||||||
|
matchCounts.isEmpty &&
|
||||||
|
winRates.isEmpty,
|
||||||
|
replacement: Column(
|
||||||
|
children: [
|
||||||
StatisticsTile(
|
StatisticsTile(
|
||||||
icon: Icons.sports_score,
|
icon: Icons.sports_score,
|
||||||
title: 'Wins',
|
title: 'Wins',
|
||||||
@@ -84,6 +92,14 @@ class _StatisticsViewState extends State<StatisticsView> {
|
|||||||
itemCount: 10,
|
itemCount: 10,
|
||||||
barColor: Colors.green,
|
barColor: Colors.green,
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: const TopCenteredMessage(
|
||||||
|
icon: Icons.info,
|
||||||
|
title: 'Info',
|
||||||
|
message: 'No statistics available',
|
||||||
|
),
|
||||||
|
),
|
||||||
SizedBox(height: MediaQuery.paddingOf(context).bottom),
|
SizedBox(height: MediaQuery.paddingOf(context).bottom),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user