From f541579920bb23f997d787c85822e5f2b6bc7834 Mon Sep 17 00:00:00 2001 From: kwainright Date: Tue, 31 Mar 2020 23:49:55 -0400 Subject: [PATCH 1/4] Game Details page - no api - not finished. Getting updates for master branch --- lib/route_generator.dart | 3 + lib/screens/game_details.dart | 140 ++++++++++++++++++++++++++++++++++ lib/screens/home_widget.dart | 6 ++ pubspec.lock | 2 +- 4 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 lib/screens/game_details.dart diff --git a/lib/route_generator.dart b/lib/route_generator.dart index 3e01d5e..44e45cb 100644 --- a/lib/route_generator.dart +++ b/lib/route_generator.dart @@ -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 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(); } diff --git a/lib/screens/game_details.dart b/lib/screens/game_details.dart new file mode 100644 index 0000000..cf7024c --- /dev/null +++ b/lib/screens/game_details.dart @@ -0,0 +1,140 @@ +import 'package:flutter/material.dart'; + + +class Details extends StatelessWidget { + + static final List colorList = [ + 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: [ + Container( + color: Colors.blueAccent, + child: Padding( + padding: EdgeInsets.symmetric(vertical: 25.0, horizontal: 50.0), + child: Row( + children: [ + Padding( + padding: EdgeInsets.only(right: 50.0), + child: Column( + children: [ + FlutterLogo(), + Text('Team'), + ], + ), + ), + Text('10'), + Text('Final'), + Text('30'), + Padding( + padding: EdgeInsets.only(left: 50.0), + child: Column( + children: [ + FlutterLogo(), + Text('Team'), + ], + ), + ), + ], + ), + ), + ), + Container( + color: Colors.blue, + child: Row( + children: [ + 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: [ + 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; +} + + + diff --git a/lib/screens/home_widget.dart b/lib/screens/home_widget.dart index 6c0488d..3dc696c 100644 --- a/lib/screens/home_widget.dart +++ b/lib/screens/home_widget.dart @@ -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'), + ), + ), ], ), ), diff --git a/pubspec.lock b/pubspec.lock index a5d537b..57b0841 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: From 5588c34bc41e85970b6425d4a47d99a5dafc6285 Mon Sep 17 00:00:00 2001 From: kwainright Date: Wed, 1 Apr 2020 23:47:11 -0400 Subject: [PATCH 2/4] Game Details page - no api - Proof of concept. Styling finished for the most part --- lib/screens/game_details.dart | 234 ++++++++++++++++++++++++++-------- 1 file changed, 182 insertions(+), 52 deletions(-) diff --git a/lib/screens/game_details.dart b/lib/screens/game_details.dart index cf7024c..dc84002 100644 --- a/lib/screens/game_details.dart +++ b/lib/screens/game_details.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -25,64 +26,173 @@ class Details extends StatelessWidget { title: Text('Game Details'), backgroundColor: Colors.green, ), - body: Column( - children: [ - Container( - color: Colors.blueAccent, - child: Padding( - padding: EdgeInsets.symmetric(vertical: 25.0, horizontal: 50.0), - child: Row( - children: [ - Padding( - padding: EdgeInsets.only(right: 50.0), - child: Column( - children: [ - FlutterLogo(), - Text('Team'), - ], + body: Container( + color: Colors.black12, + child: Column( + children: [ + Container( + color: Colors.black12, + child: Container( + decoration: BoxDecoration( + border: Border( + top: BorderSide( + color: Colors.black, + width: 2.0, ), ), - Text('10'), - Text('Final'), - Text('30'), - Padding( - padding: EdgeInsets.only(left: 50.0), - child: Column( - children: [ - FlutterLogo(), - Text('Team'), - ], - ), + ), + child: Padding( + padding: EdgeInsets.symmetric(vertical: 20.0, horizontal: 40.0), + child: Row( + children: [ + Padding( + padding: EdgeInsets.only(right: 5), + child: Column( + children: [ + SizedBox( + height: 45, + width: 45, + child: Image.network('https://upload.wikimedia.org/wikipedia/en/thumb/3/33/Charlotte_49ers_logo.svg/1200px-Charlotte_49ers_logo.svg.png'), + ), + Text('UNCC', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 0, horizontal: 25), + child: Text('50', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold) + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 0, horizontal: 35), + child: Text('vs', + style: TextStyle( + decoration: TextDecoration.underline, + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 0, horizontal: 25), + child: Text('30', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), + ), + ), + Padding( + padding: EdgeInsets.only(left: 5), + child: Column( + children: [ + SizedBox( + width: 50, + height: 50, + child: Image.network('https://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Appalachian_State_Mountaineers_logo.svg/1200px-Appalachian_State_Mountaineers_logo.svg.png'), + ), + Text('APP St', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + ], ), - ], + ), ), ), - ), - Container( - color: Colors.blue, - child: Row( - children: [ - Padding( - padding: EdgeInsets.all(10), - child: Text('Testing'), + Container( + color: Colors.black12, + child: Container( + decoration: BoxDecoration( + border: Border( + top: BorderSide( + color: Colors.black, + width: 2.0, + ), + bottom: BorderSide( + color: Colors.black, + width: 2.0, + ), + ), ), - Padding( - padding: EdgeInsets.all(10), - child: Text('Testing'), + child: Padding( + padding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 5.0), + child: Row( + children: [ + Container( + child: Card( + child: SizedBox( + width: 90, + height: 30, + child: Center( + child: Text('Standings', + style: TextStyle(fontSize: 16), + ), + ), + ), + ), + ), + Container( + child: Card( + child: SizedBox( + width: 90, + height: 30, + child: Center( + child: Text('Schedule', + style: TextStyle(fontSize: 16), + ), + ), + ), + ), + ), + Container( + child: Card( + child: SizedBox( + width: 100, + height: 30, + child: Center( + child: Text('Play-By-Play', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ), + ), + Container( + color: Colors.black12, + child: Card( + child: SizedBox( + width: 90, + height: 30, + child: Center( + child: Text('Chat', + style: TextStyle(fontSize: 16), + ), + ), + ), + ), + ), + ], + ), ), - Padding( - padding: EdgeInsets.all(10), - child: Text('Testing'), - ), - Padding( - padding: EdgeInsets.all(10), - child: Text('Testing'), - ), - ], + ), ), - ), - - ], + Container( + child: GameUpdates(), + ), + ], + ), ), drawer: Drawer( child: ListView( @@ -125,8 +235,6 @@ class Details extends StatelessWidget { } - - } class Item { @@ -136,5 +244,27 @@ class Item { final Color color; } +class GameUpdates extends StatelessWidget{ + @override + Widget build(BuildContext context) { + return Expanded( + child: Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: 10, + itemBuilder: (context, int index){ + return Card( + child: ListTile( + title: Text('Update Heading'), + subtitle: Text('Update Details'), + ), + ); + } + ), + ), + ); + + } +} From 335ba7ec4862fef2629ae041b44e7b94caee01de Mon Sep 17 00:00:00 2001 From: kwainright Date: Thu, 9 Apr 2020 21:59:16 -0400 Subject: [PATCH 3/4] Play-by-play, no api, temp place holder data. --- lib/screens/game_details.dart | 88 +++++++++++++++++++++++++++++------ 1 file changed, 75 insertions(+), 13 deletions(-) diff --git a/lib/screens/game_details.dart b/lib/screens/game_details.dart index dc84002..584b8c2 100644 --- a/lib/screens/game_details.dart +++ b/lib/screens/game_details.dart @@ -1,6 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - +import 'dart:io'; class Details extends StatelessWidget { @@ -65,12 +65,12 @@ class Details extends StatelessWidget { ), Padding( padding: EdgeInsets.symmetric(vertical: 0, horizontal: 25), - child: Text('50', + child: Text('10', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold) ), ), Padding( - padding: EdgeInsets.symmetric(vertical: 0, horizontal: 35), + padding: EdgeInsets.symmetric(vertical: 0, horizontal: 25), child: Text('vs', style: TextStyle( decoration: TextDecoration.underline, @@ -81,7 +81,7 @@ class Details extends StatelessWidget { ), Padding( padding: EdgeInsets.symmetric(vertical: 0, horizontal: 25), - child: Text('30', + child: Text('52', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), ), @@ -92,9 +92,9 @@ class Details extends StatelessWidget { SizedBox( width: 50, height: 50, - child: Image.network('https://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Appalachian_State_Mountaineers_logo.svg/1200px-Appalachian_State_Mountaineers_logo.svg.png'), + child: Image.network('https://www.clemson.edu/brand/resources/logos/paw/orange.png'), ), - Text('APP St', + Text('Clemson', style: TextStyle( fontSize: 14, fontWeight: FontWeight.bold, @@ -244,22 +244,84 @@ class Item { final Color color; } +class Play { + final String title; + final String action; + + Play( + this.title, + this.action, + ); +} + class GameUpdates extends StatelessWidget{ + List myList = []; + final test1 = new Play('1st and 10 at CLT 25', '(6:12 - 4th) Aidan Swanson kickoff for 65 yds for a touchback'); + final test2 = new Play('2nd & 10 at CLT 25', '(5:00 - 4th) Ishod Finger run for no gain to the Charl 25'); + final test3 = new Play('3rd & 10 at CLT 25', '(4:30 - 4th) CHARLOTTE Penalty, False Start (-5 Yards) to the Charl 20'); + final test4 = new Play('3rd & 15 at CLT 20', '(4:00 - 4th) Brett Kean run for 5 yds to the Charl 25'); + final test5 = new Play('4th & 10 at CLT 25', '(3:31 - 4th) Connor Bowler punt for 48 yds , Will Brown returns for 13 yds to the Clem 40'); + final test6 = new Play('1st & 10 at CLEM 40','(3:00 - 4th) Taisun Phommachanh pass complete to Will Brown for 8 yds to the Clem 48'); + final test7 = new Play('2nd & 2 at CLEM 48','(2:40 - 4th) Chez Mellusi run for 3 yds to the Charl 49 for a 1ST down'); + final test8 = new Play('1st & 10 at CLT 49','(2:25 - 4th) Chez Mellusi run for 8 yds to the Charl 41'); + final test9 = new Play('2nd & 2 at CLT 41','(1:37 - 4th) Ben Batson run for 5 yds to the Charl 36 for a 1ST down'); + final test10 = new Play('1st & 10 at CLT 36', '(1:30 - 4th) CLEMSON Penalty, False Start (-5 Yards) to the Charl 41'); + final test11 = new Play('1st & 15 at CLT 41','(0:55 - 4th) Chez Mellusi run for 4 yds to the Charl 37'); + final test12 = new Play('2nd & 11 at CLT 37','(0:25 - 4th) Patrick McClure run for 3 yds to the Charl 34'); + final test13 = new Play('3rd & 8 at CLT 34','(0:05 - 4th) Chez Mellusi run for 7 yds to the Charl 27'); + final test14 = new Play('4th & 1 at CLT 27','(0:00 - 4th) Patrick McClure run for 9 yds to the Charl 18 for a 1ST down'); + @override Widget build(BuildContext context) { + var myStream = Stream.periodic(Duration(seconds:5), (x) => x).take(15); + myList.add(test1); + myList.add(test2); + myList.add(test3); + myList.add(test4); + myList.add(test5); + myList.add(test6); + myList.add(test7); + myList.add(test8); + myList.add(test9); + myList.add(test10); + myList.add(test11); + myList.add(test12); + myList.add(test13); + myList.add(test14); + + /* return StreamBuilder( + stream: myStream, + initialData: '0', + builder: (ctx, snapshot){ + return Card( + child: Padding( + padding: EdgeInsets.symmetric(vertical: 10, horizontal: 5), + child: Text('${snapshot.data}'), + ), + ); + }, + ); */ + return Expanded( child: Container( child: ListView.builder( scrollDirection: Axis.vertical, - itemCount: 10, + itemCount: myList.length, itemBuilder: (context, int index){ - return Card( - child: ListTile( - title: Text('Update Heading'), - subtitle: Text('Update Details'), - ), - ); + return Card( + child: Padding( + padding: EdgeInsets.symmetric(vertical: 5,horizontal: 10), + child: ListTile( + title: Text('${myList[index].title}'), + subtitle: Padding( + padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20), + child: Text('${myList[index].action}'), + ), + ), + ), + ); + } ), ), From 315bac2891f21585af1bcca0c9aeeb600a48aea0 Mon Sep 17 00:00:00 2001 From: Carlos Lopez-Rosario Date: Fri, 10 Apr 2020 13:45:15 -0400 Subject: [PATCH 4/4] 90 -> 89 cause android sized screamed --- lib/screens/game_details.dart | 2 +- pubspec.lock | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/screens/game_details.dart b/lib/screens/game_details.dart index 584b8c2..ff25921 100644 --- a/lib/screens/game_details.dart +++ b/lib/screens/game_details.dart @@ -173,7 +173,7 @@ class Details extends StatelessWidget { color: Colors.black12, child: Card( child: SizedBox( - width: 90, + width: 89, height: 30, child: Center( child: Text('Chat', diff --git a/pubspec.lock b/pubspec.lock index 764cf68..3e6efa1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,21 +7,21 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "2.0.11" + version: "2.0.13" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.5.2" + version: "1.6.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.4.1" bloc: dependency: transitive description: @@ -35,21 +35,21 @@ packages: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "2.0.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.1.3" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.14.12" convert: dependency: transitive description: @@ -63,7 +63,7 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "2.1.4" cupertino_icons: dependency: "direct main" description: @@ -113,7 +113,7 @@ packages: name: image url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.12" matcher: dependency: transitive description: @@ -169,7 +169,7 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.1.3" rxdart: dependency: transitive description: @@ -216,7 +216,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.7.0" stack_trace: dependency: transitive description: @@ -251,7 +251,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.11" + version: "0.2.15" typed_data: dependency: transitive description: @@ -272,7 +272,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "3.5.0" + version: "3.6.1" sdks: dart: ">=2.6.0 <3.0.0" flutter: ">=1.12.13+hotfix.4 <2.0.0"