use standardized TopCenteredMessage
This commit is contained in:
@@ -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',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user