Compare commits
2 Commits
a29123c964
...
9ee9da2ac8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ee9da2ac8 | ||
|
|
aa208bb2ef |
@@ -4,6 +4,7 @@ import 'package:game_tracker/data/dto/game.dart';
|
|||||||
import 'package:game_tracker/data/dto/group.dart';
|
import 'package:game_tracker/data/dto/group.dart';
|
||||||
import 'package:game_tracker/data/dto/player.dart';
|
import 'package:game_tracker/data/dto/player.dart';
|
||||||
import 'package:game_tracker/presentation/widgets/tiles/game_history_tile.dart';
|
import 'package:game_tracker/presentation/widgets/tiles/game_history_tile.dart';
|
||||||
|
import 'package:game_tracker/presentation/widgets/top_centered_message.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:skeletonizer/skeletonizer.dart';
|
import 'package:skeletonizer/skeletonizer.dart';
|
||||||
|
|
||||||
@@ -61,17 +62,21 @@ class _GameHistoryViewState extends State<GameHistoryView> {
|
|||||||
builder: (BuildContext context, AsyncSnapshot<List<Game>> snapshot) {
|
builder: (BuildContext context, AsyncSnapshot<List<Game>> snapshot) {
|
||||||
if (snapshot.hasError) {
|
if (snapshot.hasError) {
|
||||||
return const Center(
|
return const Center(
|
||||||
heightFactor: 4,
|
child: TopCenteredMessage(
|
||||||
child: Text(
|
icon: Icons.report,
|
||||||
'Error while loading games.',
|
title: 'Error',
|
||||||
|
message: 'Game data could not be loaded',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (snapshot.connectionState == ConnectionState.done &&
|
if (snapshot.connectionState == ConnectionState.done &&
|
||||||
(!snapshot.hasData || snapshot.data!.isEmpty)) {
|
(!snapshot.hasData || snapshot.data!.isEmpty)) {
|
||||||
return const Center(
|
return const Center(
|
||||||
heightFactor: 4,
|
child: TopCenteredMessage(
|
||||||
child: Text('No games available.'),
|
icon: Icons.report,
|
||||||
|
title: 'Error',
|
||||||
|
message: 'No Games Available',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +107,7 @@ class _GameHistoryViewState extends State<GameHistoryView> {
|
|||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
if (index == games.length) {
|
if (index == games.length) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: MediaQuery.paddingOf(context).bottom - 20,
|
height: MediaQuery.paddingOf(context).bottom - 80,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return GameHistoryTile(game: games[index]);
|
return GameHistoryTile(game: games[index]);
|
||||||
|
|||||||
Reference in New Issue
Block a user