added args to chat, and game cards can take you there too
This commit is contained in:
@@ -17,7 +17,7 @@ class GameDetailsWidget extends StatelessWidget {
|
|||||||
body: Column(
|
body: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
GameDetailsHeader(gameCard),
|
GameDetailsHeader(gameCard),
|
||||||
EasyAccess(),
|
EasyAccess(gameCard),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -131,6 +131,12 @@ class GameDetailsHeader extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class EasyAccess extends StatelessWidget {
|
class EasyAccess extends StatelessWidget {
|
||||||
|
final sport_schedule gameCard;
|
||||||
|
|
||||||
|
const EasyAccess(
|
||||||
|
this.gameCard,
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var size = MediaQuery.of(context).size;
|
var size = MediaQuery.of(context).size;
|
||||||
@@ -165,7 +171,10 @@ class EasyAccess extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () => {
|
onTap: () => {
|
||||||
print("Tapped $label")
|
print("Tapped $label"),
|
||||||
|
if(label == 'Chat'){
|
||||||
|
Navigator.pushNamed(context, '/Chat', arguments: gameCard.sportTitle)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class RouteGenerator {
|
|||||||
case '/Standing':
|
case '/Standing':
|
||||||
return MaterialPageRoute(builder: (_) => Standing(args));
|
return MaterialPageRoute(builder: (_) => Standing(args));
|
||||||
case '/Chat':
|
case '/Chat':
|
||||||
return MaterialPageRoute(builder: (_) => Chat());
|
return MaterialPageRoute(builder: (_) => Chat(args));
|
||||||
case '/Details':
|
case '/Details':
|
||||||
return MaterialPageRoute(builder: (_) => GameDetailsWidget(args));
|
return MaterialPageRoute(builder: (_) => GameDetailsWidget(args));
|
||||||
case '/Favorites':
|
case '/Favorites':
|
||||||
|
|||||||
@@ -1,40 +1,19 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class Chat extends StatelessWidget{
|
class Chat extends StatelessWidget{
|
||||||
|
String sport;
|
||||||
|
Chat(this.sport);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return StatefulBuilder(
|
return StatefulBuilder(
|
||||||
builder: (context, StateSetter setState) => Scaffold(
|
builder: (context, StateSetter setState) => Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
title: Text("49ers"),
|
title: Text('$sport Chat'),
|
||||||
backgroundColor: Colors.green,
|
backgroundColor: Colors.green,
|
||||||
),
|
),
|
||||||
body: Text("Chat Goes Here"),
|
body: Center(child: Text("Chat Goes Here")),
|
||||||
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, '/'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,6 +102,12 @@ class Sport extends StatelessWidget {
|
|||||||
onPressed: () => Navigator.pushNamed(context, '/Schedule',arguments: [sport_ID, _curSport.name],),
|
onPressed: () => Navigator.pushNamed(context, '/Schedule',arguments: [sport_ID, _curSport.name],),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
title: IconButton(
|
||||||
|
icon: Icon(Icons.message),
|
||||||
|
onPressed: () => Navigator.pushNamed(context, '/Chat',arguments: _curSport.name),
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -147,12 +147,12 @@ class GameCard extends StatelessWidget {
|
|||||||
|
|
||||||
Widget buildCard(BuildContext ctx, double logoWidth, Map<int, String> _months) {
|
Widget buildCard(BuildContext ctx, double logoWidth, Map<int, String> _months) {
|
||||||
|
|
||||||
return GestureDetector(
|
return InkWell(
|
||||||
|
splashColor: Colors.green,
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.black12,
|
color: Colors.black12,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
//mainAxisSize: MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _homeAwayImageOrder(
|
child: _homeAwayImageOrder(
|
||||||
|
|||||||
Reference in New Issue
Block a user