Game Details page - no api - not finished. Getting updates for master branch

This commit is contained in:
kwainright
2020-03-31 23:49:55 -04:00
parent bb6f0fd0e5
commit f541579920
4 changed files with 150 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import 'package:capstone_hungry_hippos/screens/standing.dart';
import 'package:flutter/material.dart';
import 'package:capstone_hungry_hippos/screens/home_widget.dart';
import 'package:capstone_hungry_hippos/screens/sport.dart';
import 'package:capstone_hungry_hippos/screens/game_details.dart';
class RouteGenerator {
static Route<dynamic> generateRoute(RouteSettings settings){
@@ -21,6 +22,8 @@ class RouteGenerator {
return MaterialPageRoute(builder: (_) => Standing());
case '/Chat':
return MaterialPageRoute(builder: (_) => Chat());
case '/Details':
return MaterialPageRoute(builder: (_) => Details());
default:
return _errorRoute();
}

View File

@@ -0,0 +1,140 @@
import 'package:flutter/material.dart';
class Details extends StatelessWidget {
static final List<Item> colorList = <Item>[
const Item('FootBall', Colors.green),
const Item("BasketBall", Colors.red),
const Item("Soccer", Colors.pinkAccent),
const Item('Baseball', Colors.orange),
];
Item _curSport = colorList[0];
@override
Widget build(BuildContext context) {
Item selectedSport;
return StatefulBuilder(
builder: (context, StateSetter setState) => Scaffold(
appBar: AppBar(
centerTitle: false,
title: Text('Game Details'),
backgroundColor: Colors.green,
),
body: Column(
children: <Widget>[
Container(
color: Colors.blueAccent,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 25.0, horizontal: 50.0),
child: Row(
children: <Widget>[
Padding(
padding: EdgeInsets.only(right: 50.0),
child: Column(
children: <Widget>[
FlutterLogo(),
Text('Team'),
],
),
),
Text('10'),
Text('Final'),
Text('30'),
Padding(
padding: EdgeInsets.only(left: 50.0),
child: Column(
children: <Widget>[
FlutterLogo(),
Text('Team'),
],
),
),
],
),
),
),
Container(
color: Colors.blue,
child: Row(
children: <Widget>[
Padding(
padding: EdgeInsets.all(10),
child: Text('Testing'),
),
Padding(
padding: EdgeInsets.all(10),
child: Text('Testing'),
),
Padding(
padding: EdgeInsets.all(10),
child: Text('Testing'),
),
Padding(
padding: EdgeInsets.all(10),
child: Text('Testing'),
),
],
),
),
],
),
drawer: Drawer(
child: ListView(
children: <Widget>[
DrawerHeader(
child: Text(
'Drawer Header',
style: TextStyle(
color: Colors.white,
fontSize: 24,
),
),
decoration: BoxDecoration(
color: Colors.green,
),
),
ListTile(
title: IconButton(
icon: Icon(Icons.home),
onPressed: () => Navigator.pushNamed(context, '/'),
),
),
ListTile(
title: IconButton(
icon: Icon(Icons.table_chart),
onPressed: () => Navigator.pushNamed(context, '/Standing'),
),
),
ListTile(
title: IconButton(
icon: Icon(Icons.calendar_today),
onPressed: () => Navigator.pushNamed(context, '/Schedule'),
),
),
],
),
),
),
);
}
}
class Item {
const Item(this.name, this.color);
final String name;
final Color color;
}

View File

@@ -32,6 +32,12 @@ class Home extends StatelessWidget {
onPressed: () => Navigator.pushNamed(context, '/Chat'),
),
),
ListTile( //added by Kaleb to test details page. Will update path / delete when we have game tiles implemented.
title: IconButton(
icon: Icon(Icons.book),
onPressed: () => Navigator.pushNamed(context, '/Details'),
),
),
],
),
),

View File

@@ -218,7 +218,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.15"
version: "0.2.11"
typed_data:
dependency: transitive
description: