Overhauled layout building
This commit is contained in:
@@ -1,66 +1,111 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:game_tracker/presentation/widgets/game_tile.dart';
|
||||
import 'package:game_tracker/presentation/widgets/info_tile.dart';
|
||||
import 'package:game_tracker/presentation/widgets/quick_create_button.dart';
|
||||
import 'package:game_tracker/presentation/widgets/quick_info_tile.dart';
|
||||
import 'package:game_tracker/presentation/widgets/tiles/info_tile.dart';
|
||||
import 'package:game_tracker/presentation/widgets/tiles/quick_info_tile.dart';
|
||||
|
||||
class HomeView extends StatelessWidget {
|
||||
const HomeView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
QuickInfoTile(title: 'Games', icon: Icons.casino, value: 42),
|
||||
QuickInfoTile(
|
||||
title: 'Groups',
|
||||
icon: Icons.groups_rounded,
|
||||
value: 5,
|
||||
),
|
||||
],
|
||||
),
|
||||
const InfoTile(
|
||||
title: 'Recent Games',
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.0, vertical: 16.0),
|
||||
icon: Icons.timer,
|
||||
content: GameTile(),
|
||||
),
|
||||
InfoTile(
|
||||
title: 'Quick Create',
|
||||
height: 210,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 16.0),
|
||||
icon: Icons.add_box_rounded,
|
||||
content: Column(
|
||||
return LayoutBuilder(
|
||||
builder: (BuildContext context, BoxConstraints constraints) {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
QuickCreateButton(text: 'Cabo', onPressed: () {}),
|
||||
QuickCreateButton(text: 'Uno', onPressed: () {}),
|
||||
QuickInfoTile(
|
||||
width: constraints.maxWidth * 0.45,
|
||||
height: constraints.maxHeight * 0.15,
|
||||
title: 'Games',
|
||||
icon: Icons.casino,
|
||||
value: 42,
|
||||
),
|
||||
SizedBox(width: constraints.maxWidth * 0.05),
|
||||
QuickInfoTile(
|
||||
width: constraints.maxWidth * 0.45,
|
||||
height: constraints.maxHeight * 0.15,
|
||||
title: 'Groups',
|
||||
icon: Icons.groups_rounded,
|
||||
value: 5,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
QuickCreateButton(text: 'Phase 10', onPressed: () {}),
|
||||
QuickCreateButton(text: 'Category 5', onPressed: () {}),
|
||||
],
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 24.0),
|
||||
child: InfoTile(
|
||||
width: constraints.maxWidth * 0.95,
|
||||
title: 'Recent Games',
|
||||
icon: Icons.timer,
|
||||
content: const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 40.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GameTile(
|
||||
gameTitle: 'Gamenight',
|
||||
gameType: 'Cabo',
|
||||
ruleset: 'Lowest Points',
|
||||
players: '5 Players',
|
||||
winner: 'Leonard',
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Divider(),
|
||||
),
|
||||
GameTile(
|
||||
gameTitle: 'Schoolbreak',
|
||||
gameType: 'Uno',
|
||||
ruleset: 'Highest Points',
|
||||
players: 'The Gang',
|
||||
winner: 'Lina',
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
QuickCreateButton(text: 'Category 6', onPressed: () {}),
|
||||
QuickCreateButton(text: 'Category 7', onPressed: () {}),
|
||||
],
|
||||
InfoTile(
|
||||
width: constraints.maxWidth * 0.95,
|
||||
title: 'Quick Create',
|
||||
icon: Icons.add_box_rounded,
|
||||
content: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
QuickCreateButton(text: 'Category 1', onPressed: () {}),
|
||||
QuickCreateButton(text: 'Category 2', onPressed: () {}),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
QuickCreateButton(text: 'Category 3', onPressed: () {}),
|
||||
QuickCreateButton(text: 'Category 4', onPressed: () {}),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
QuickCreateButton(text: 'Category 5', onPressed: () {}),
|
||||
QuickCreateButton(text: 'Category 6', onPressed: () {}),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user