Compare commits
5 Commits
a6f40456d8
...
c1e032208c
| Author | SHA1 | Date | |
|---|---|---|---|
| c1e032208c | |||
| 258f610e28 | |||
| deab074885 | |||
| 38466c6056 | |||
| 8d8d4319d2 |
@@ -178,9 +178,15 @@ class _GameHistoryViewState extends State<GameHistoryView> {
|
||||
|
||||
Widget gameHistoryListView(allGameData, suggestedGameData) {
|
||||
if (suggestedGameData.isEmpty && allGameData.isEmpty) {
|
||||
return TopCenteredMessage(message: "Keine Spiele erstellt");
|
||||
return TopCenteredMessage(
|
||||
icon: Icons.info,
|
||||
title: "Info",
|
||||
message: "Keine Spiele erstellt",
|
||||
);
|
||||
} else if (suggestedGameData.isEmpty) {
|
||||
return TopCenteredMessage(
|
||||
icon: Icons.search,
|
||||
title: "Info",
|
||||
message: "Kein Spiel mit den Suchparametern gefunden.",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:game_tracker/data/db/database.dart';
|
||||
import 'package:game_tracker/data/dto/group.dart';
|
||||
import 'package:game_tracker/data/dto/player.dart';
|
||||
import 'package:game_tracker/presentation/widgets/full_width_button.dart';
|
||||
import 'package:game_tracker/presentation/widgets/group_tile.dart';
|
||||
import 'package:game_tracker/presentation/widgets/tiles/group_tile.dart';
|
||||
import 'package:game_tracker/presentation/widgets/top_centered_message.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:skeletonizer/skeletonizer.dart';
|
||||
@@ -50,7 +50,9 @@ class _GroupsViewState extends State<GroupsView> {
|
||||
if (snapshot.hasError) {
|
||||
return const Center(
|
||||
child: TopCenteredMessage(
|
||||
message: 'Error while loading group data.',
|
||||
icon: Icons.report,
|
||||
title: "Error",
|
||||
message: 'Group data couldn\'t\nbe loaded.',
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -58,6 +60,8 @@ class _GroupsViewState extends State<GroupsView> {
|
||||
(!snapshot.hasData || snapshot.data!.isEmpty)) {
|
||||
return const Center(
|
||||
child: TopCenteredMessage(
|
||||
icon: Icons.info,
|
||||
title: "Info",
|
||||
message: 'No groups created yet.',
|
||||
),
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ class FullWidthButton extends StatelessWidget {
|
||||
return ElevatedButton(
|
||||
onPressed: onPressed,
|
||||
style: ElevatedButton.styleFrom(
|
||||
minimumSize: Size(MediaQuery.of(context).size.width * 0.90, 60),
|
||||
minimumSize: Size(MediaQuery.sizeOf(context).width * 0.9, 60),
|
||||
backgroundColor: CustomTheme.primaryColor,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
|
||||
@@ -11,8 +11,7 @@ class GroupTile extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width * 0.90,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: CustomTheme.boxColor,
|
||||
@@ -30,7 +29,7 @@ class GroupTile extends StatelessWidget {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
@@ -38,11 +37,11 @@ class GroupTile extends StatelessWidget {
|
||||
'${group.members.length}',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: 20,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 3),
|
||||
const Icon(Icons.group),
|
||||
const Icon(Icons.group, size: 22),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
@@ -66,7 +65,7 @@ class GroupTile extends StatelessWidget {
|
||||
child: Text(
|
||||
member.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 17,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
@@ -1,9 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TopCenteredMessage extends StatelessWidget {
|
||||
const TopCenteredMessage({super.key, required this.message});
|
||||
const TopCenteredMessage({
|
||||
super.key,
|
||||
required this.icon,
|
||||
required this.title,
|
||||
required this.message,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final String message;
|
||||
final IconData icon;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -11,10 +18,21 @@ class TopCenteredMessage extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(top: 100),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 10),
|
||||
alignment: Alignment.topCenter,
|
||||
child: Text(
|
||||
message,
|
||||
style: const TextStyle(fontSize: 20),
|
||||
textAlign: TextAlign.center,
|
||||
child: Column(
|
||||
children: [
|
||||
Icon(icon, size: 45),
|
||||
SizedBox(height: 10),
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Text(
|
||||
message,
|
||||
style: const TextStyle(fontSize: 16),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user