diff --git a/lib/monthly_calendar.dart b/lib/monthly_calendar.dart index 13051b8..9777fc7 100644 --- a/lib/monthly_calendar.dart +++ b/lib/monthly_calendar.dart @@ -208,14 +208,20 @@ class _Calendar extends State with TickerProviderStateMixin { markersBuilder: (context, date, events, holidays) { final miniBox = []; - if (events.isNotEmpty) { miniBox.add( Positioned( right: 0,top: 0, left: 0, bottom: 0, - child: _buildEventsMarker(date, events[0].location_indicator), + child: _buildEventsMarker(date, events[0].location_indicator, true, events), ), ); + if (events.length > 1) + miniBox.add( + Positioned( + right: 1, bottom: 1, + child: _buildEventsMarker(date, events[0].location_indicator, false, events), + ) + ); } return miniBox; @@ -234,7 +240,10 @@ class _Calendar extends State with TickerProviderStateMixin { } //----- Creates event box display (mini box) ----- - Widget _buildEventsMarker(DateTime date, String location) { + Widget _buildEventsMarker(DateTime date, String location, bool main, events) { + String s; + if (main) {s = "${date.day}";} else {s = "${events.length}";} + return AnimatedContainer( duration: const Duration(milliseconds: 300), @@ -253,7 +262,7 @@ class _Calendar extends State with TickerProviderStateMixin { //if selected date && home game / else away game color: _calController.isSelected(date) ? Colors.blue[400] - : _homeAwayColor(location), //UNCC Green + : _homeAwayColor(location, main), //UNCC Green //: Colors.grey, ), @@ -262,7 +271,7 @@ class _Calendar extends State with TickerProviderStateMixin { child: Center( child: Text( - '${date.day}', + s, style: TextStyle().copyWith( color: Colors.white, fontSize: 12.0, @@ -272,7 +281,7 @@ class _Calendar extends State with TickerProviderStateMixin { ); } - Color _homeAwayColor(String location){ + Color _homeAwayColor(String location, bool main){ //TODO: Here should be the logic on if Home or Away return the colors // Do whatever you need to do to check home/away // my guess is if the game says vs its home @@ -285,6 +294,9 @@ class _Calendar extends State with TickerProviderStateMixin { } else { c = Colors.grey; } + if (!main){ + c = Colors.black45;//Color.fromRGBO(179, 163, 105, 1); + } return c; } diff --git a/lib/screens/schedule.dart b/lib/screens/schedule.dart index cd3efd7..b7dc1aa 100644 --- a/lib/screens/schedule.dart +++ b/lib/screens/schedule.dart @@ -3,17 +3,17 @@ import '../monthly_calendar.dart'; import '../screens/sport.dart' as globals; class Schedule extends StatelessWidget{ - final int sportID; - Schedule(this.sportID); + final List sport; + Schedule(this.sport); @override Widget build(BuildContext context) { - var calendar = Calendar(sportID); + var calendar = Calendar(sport[0]); return StatefulBuilder( builder: (context, StateSetter setState) => Scaffold( appBar: AppBar( centerTitle: false, - title: Text("49ers"), + title: Text("${sport[1]}"), backgroundColor: Colors.green, ), body: Container ( diff --git a/lib/screens/sport.dart b/lib/screens/sport.dart index 049ba2b..52e33a0 100644 --- a/lib/screens/sport.dart +++ b/lib/screens/sport.dart @@ -105,7 +105,7 @@ class Sport extends StatelessWidget { ListTile( title: IconButton( icon: Icon(Icons.calendar_today), - onPressed: () => Navigator.pushNamed(context, '/Schedule',arguments: sport_ID), + onPressed: () => Navigator.pushNamed(context, '/Schedule',arguments: [sport_ID, _curSport.name],), ), ), ],