Corrected game tile skeleton
This commit is contained in:
@@ -26,7 +26,8 @@ class _HomeViewState extends State<HomeView> {
|
|||||||
_gameCountFuture = db.gameDao.getGameCount();
|
_gameCountFuture = db.gameDao.getGameCount();
|
||||||
_groupCountFuture = db.groupDao.getGroupCount();
|
_groupCountFuture = db.groupDao.getGroupCount();
|
||||||
|
|
||||||
Future.wait([_gameCountFuture, _groupCountFuture]).then((_) {
|
Future.wait([_gameCountFuture, _groupCountFuture]).then((_) async {
|
||||||
|
await Future.delayed(const Duration(milliseconds: 50));
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
@@ -102,38 +103,30 @@ class _HomeViewState extends State<HomeView> {
|
|||||||
width: constraints.maxWidth * 0.95,
|
width: constraints.maxWidth * 0.95,
|
||||||
title: 'Recent Games',
|
title: 'Recent Games',
|
||||||
icon: Icons.timer,
|
icon: Icons.timer,
|
||||||
content: Padding(
|
content: const Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 40.0),
|
padding: EdgeInsets.symmetric(horizontal: 40.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Skeleton.unite(
|
GameTile(
|
||||||
unite: true,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
child: const GameTile(
|
|
||||||
gameTitle: 'Gamenight',
|
gameTitle: 'Gamenight',
|
||||||
gameType: 'Cabo',
|
gameType: 'Cabo',
|
||||||
ruleset: 'Lowest Points',
|
ruleset: 'Lowest Points',
|
||||||
players: '5 Players',
|
players: '5 Players',
|
||||||
winner: 'Leonard',
|
winner: 'Leonard',
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 8.0),
|
padding: EdgeInsets.symmetric(vertical: 8.0),
|
||||||
child: Divider(),
|
child: Divider(),
|
||||||
),
|
),
|
||||||
Skeleton.unite(
|
GameTile(
|
||||||
unite: true,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
child: const GameTile(
|
|
||||||
gameTitle: 'Schoolbreak',
|
gameTitle: 'Schoolbreak',
|
||||||
gameType: 'Uno',
|
gameType: 'Uno',
|
||||||
ruleset: 'Highest Points',
|
ruleset: 'Highest Points',
|
||||||
players: 'The Gang',
|
players: 'The Gang',
|
||||||
winner: 'Lina',
|
winner: 'Lina',
|
||||||
),
|
),
|
||||||
),
|
|
||||||
SizedBox(height: 8),
|
SizedBox(height: 8),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:game_tracker/core/custom_theme.dart';
|
import 'package:game_tracker/core/custom_theme.dart';
|
||||||
|
import 'package:skeletonizer/skeletonizer.dart';
|
||||||
|
|
||||||
class GameTile extends StatefulWidget {
|
class GameTile extends StatefulWidget {
|
||||||
final String gameTitle;
|
final String gameTitle;
|
||||||
@@ -48,11 +49,13 @@ class _GameTileState extends State<GameTile> {
|
|||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
color: CustomTheme.primaryColor,
|
color: CustomTheme.primaryColor,
|
||||||
),
|
),
|
||||||
|
child: Skeleton.ignore(
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.ruleset,
|
widget.ruleset,
|
||||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
Center(
|
Center(
|
||||||
heightFactor: 1.5,
|
heightFactor: 1.5,
|
||||||
child: Text(
|
child: Text(
|
||||||
@@ -68,6 +71,7 @@ class _GameTileState extends State<GameTile> {
|
|||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
color: Colors.yellow.shade300,
|
color: Colors.yellow.shade300,
|
||||||
),
|
),
|
||||||
|
child: Skeleton.ignore(
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@@ -84,6 +88,7 @@ class _GameTileState extends State<GameTile> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user