Merge pull request 'Bei 0 gespielten Matches keine Stats anzeigen' (#111) from enhancement/109-bei-0-gespielten-matches-keine-stats-anzeigen into development
Reviewed-on: #111
This commit was merged in pull request #111.
This commit is contained in:
@@ -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,31 +59,46 @@ 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),
|
||||||
StatisticsTile(
|
Visibility(
|
||||||
icon: Icons.sports_score,
|
visible:
|
||||||
title: 'Wins',
|
winCounts.isEmpty &&
|
||||||
width: constraints.maxWidth * 0.95,
|
matchCounts.isEmpty &&
|
||||||
values: winCounts,
|
winRates.isEmpty,
|
||||||
itemCount: 3,
|
replacement: Column(
|
||||||
barColor: Colors.blue,
|
children: [
|
||||||
),
|
StatisticsTile(
|
||||||
SizedBox(height: constraints.maxHeight * 0.02),
|
icon: Icons.sports_score,
|
||||||
StatisticsTile(
|
title: 'Wins',
|
||||||
icon: Icons.percent,
|
width: constraints.maxWidth * 0.95,
|
||||||
title: 'Winrate',
|
values: winCounts,
|
||||||
width: constraints.maxWidth * 0.95,
|
itemCount: 3,
|
||||||
values: winRates,
|
barColor: Colors.blue,
|
||||||
itemCount: 5,
|
),
|
||||||
barColor: Colors.orange[700]!,
|
SizedBox(height: constraints.maxHeight * 0.02),
|
||||||
),
|
StatisticsTile(
|
||||||
SizedBox(height: constraints.maxHeight * 0.02),
|
icon: Icons.percent,
|
||||||
StatisticsTile(
|
title: 'Winrate',
|
||||||
icon: Icons.casino,
|
width: constraints.maxWidth * 0.95,
|
||||||
title: 'Amount of Matches',
|
values: winRates,
|
||||||
width: constraints.maxWidth * 0.95,
|
itemCount: 5,
|
||||||
values: matchCounts,
|
barColor: Colors.orange[700]!,
|
||||||
itemCount: 10,
|
),
|
||||||
barColor: Colors.green,
|
SizedBox(height: constraints.maxHeight * 0.02),
|
||||||
|
StatisticsTile(
|
||||||
|
icon: Icons.casino,
|
||||||
|
title: 'Amount of Matches',
|
||||||
|
width: constraints.maxWidth * 0.95,
|
||||||
|
values: matchCounts,
|
||||||
|
itemCount: 10,
|
||||||
|
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