12 Commits

Author SHA1 Message Date
kconnel7
ac6306dca1 Calendar - Finished 2020-04-30 21:17:59 -04:00
kconnel7
c6d811331d Monthly Calendar - All Sports work & Changed layout to look better 2020-04-25 16:10:26 -04:00
clopezr1
7ba8fcb09c selected is gold 2020-04-23 18:22:36 -04:00
clopezr1
3a8397b89e Calendar shows what sport, and little box for games with more than 1 game 2020-04-23 17:49:34 -04:00
clopezr1
ff26f31dc8 Color of Mini indicator is Based on location 2020-04-23 16:22:33 -04:00
clopezr1
74aa580f28 says day on events 2020-04-23 15:10:14 -04:00
clopezr1
5bc25f8074 The event notification now appears over the entire date instead of mini 2020-04-23 15:08:49 -04:00
kconnel7
8cf18dec0a Monthly Calendar - Softball, Volleyball, Men/Women Tennis Works 2020-04-22 18:38:54 -04:00
Carlos Lopez-Rosario
273a738fe0 no more calendar global use 2020-04-18 11:10:59 -04:00
Carlos Lopez-Rosario
39912bd37e Sports page passes game ID to Schedule/Calendar properly and generates correct calendar 2020-04-18 11:10:13 -04:00
Carlos Lopez-Rosario
9e3541c119 Gender Switch now properly appears on the correct sports and changes the sport ID properly 2020-04-18 10:37:40 -04:00
Carlos Lopez-Rosario
b3fb054c45 Route to sports takes an argument and goes to proper sport 2020-04-17 14:02:30 -04:00
9 changed files with 241 additions and 128 deletions

90
ios/Podfile Normal file
View File

@@ -0,0 +1,90 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end
end
generated_key_values
end
target 'Runner' do
use_frameworks!
use_modular_headers!
# Flutter Pod
copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
unless File.exist?(copied_framework_path)
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
end
# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'
# Plugin Pods
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end

34
ios/Podfile.lock Normal file
View File

@@ -0,0 +1,34 @@
PODS:
- Flutter (1.0.0)
- shared_preferences (0.0.1):
- Flutter
- shared_preferences_macos (0.0.1):
- Flutter
- shared_preferences_web (0.0.1):
- Flutter
DEPENDENCIES:
- Flutter (from `Flutter`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
EXTERNAL SOURCES:
Flutter:
:path: Flutter
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
shared_preferences_macos:
:path: ".symlinks/plugins/shared_preferences_macos/ios"
shared_preferences_web:
:path: ".symlinks/plugins/shared_preferences_web/ios"
SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
shared_preferences: 430726339841afefe5142b9c1f50cb6bd7793e01
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
PODFILE CHECKSUM: 083258d7f5e80b42ea9bfee905fe93049bc04c64
COCOAPODS: 1.7.5

View File

@@ -213,14 +213,9 @@
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;

View File

@@ -3,34 +3,38 @@ import 'package:http/http.dart' as http;
import 'package:table_calendar/table_calendar.dart';
import 'screens/sport_schedule.dart';
import 'screens/sport.dart' as globals;
import 'dart:convert';
class Calendar extends StatefulWidget {
final int sportID;
Calendar(this.sportID);
@override
_Calendar createState() => _Calendar();
_Calendar createState() => _Calendar(sportID);
}
//List<sport_schedule> _selectedEvents; //original that makes events work
List _selectedEvents; //Removing the <sport_schedule> allows it to still work. Proceed with caution
List _selectedEvents;
DateTime selectedDay;
Map<DateTime, List<sport_schedule>> _events;
class _Calendar extends State<Calendar> with TickerProviderStateMixin {
int sportID;
_Calendar(this. sportID);
AnimationController _animationController;
CalendarController _calController;
int sportID = globals.Sport.sport_ID;
static final sportUrl = 'https://charlotte49ers.com/services/adaptive_components.ashx?type=scoreboard&start=0&count=80';
Future<List<sport_schedule>> getEvents() async {
var url = '$sportUrl&sport_id=$sportID&name=&extra=%7B%7D';
print(url.toString());
http.Response response = await http.get(url);
Iterable games = json.decode(response.body);
return games.map<sport_schedule>((json) => sport_schedule.fromJson(json)).toList();
//return games.map((e) => sport_schedule.fromJson(e)).toList();
}
Future<Map<DateTime, List<sport_schedule>>> getGames() async {
@@ -47,10 +51,8 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
var original = mapGrab[sportEvent];
if (original == null) {
//print("null");
mapGrab[sportEvent] = [eventInfo[i]];
} else {
//print(eventInfo[i].date);
mapGrab[sportEvent] = List.from(original)..addAll([eventInfo[i]]);
}
}
@@ -59,9 +61,6 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
@override
void initState() {
final _selectedDay = DateTime.now();
//_selectedEvents = _events[_selectedDay] ?? [];
_selectedEvents = [];
_calController = CalendarController();
@@ -88,8 +87,7 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
super.dispose();
}
//void _DaySelected(DateTime day, List<sport_schedule> events) { //original that makes events work
void _DaySelected(DateTime day, List events) { //Removing the <sport_schedule> allows it to still work. Proceed with caution
void _DaySelected(DateTime day, List events) {
setState(() {
_selectedEvents = events;
selectedDay = DateTime(day.year, day.month, day.day);
@@ -124,7 +122,6 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
calendarController: _calController,
initialCalendarFormat: CalendarFormat.month,
startingDayOfWeek: StartingDayOfWeek.sunday,
//availableGestures: AvailableGestures.all,
events: _events,
availableCalendarFormats: const {
@@ -201,15 +198,20 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
markersBuilder: (context, date, events, holidays) {
final miniBox = <Widget>[];
if (events.isNotEmpty) {
miniBox.add(
Positioned(
right: 1,
bottom: 1,
child: _buildEventsMarker(date, events),
right: 0,top: 0, left: 0, bottom: 0,
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;
@@ -228,27 +230,20 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
}
//----- Creates event box display (mini box) -----
Widget _buildEventsMarker(DateTime date, List events) {
Widget _buildEventsMarker(DateTime date, String gameType, bool main, events) {
String eventNum;
if (main) {eventNum = "${date.day}";} else {eventNum = "${events.length}";}
return AnimatedContainer(
duration: const Duration(milliseconds: 300),
margin: const EdgeInsets.all(4.0),
alignment: Alignment.center,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
/*border: _calController.isSelected(date) //if selected date
? Border.all(color: Colors.black, width: 1.5,)
: _calController.isToday(date) //if today's date
? Border.all(color: Colors.black, width: 1.5,)
: Border.all(color: Colors.black, width: 0,),*/
//color: Color.fromRGBO(0, 112, 60, 1), //UNCC Green
//color: Colors.grey,
//if selected date && home game / else away game
color: _calController.isSelected(date)
? Colors.blue[400]
: Color.fromRGBO(0, 112, 60, 1), //UNCC Green
//: Colors.grey,
color: _calController.isSelected(date)
? Color.fromRGBO(179, 163, 105, 1) //UNCC Gold
: _gameTypeColor(gameType, main), //UNCC Green
borderRadius: BorderRadius.circular(10.0)
),
width: 16.0,
@@ -256,7 +251,7 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
child: Center(
child: Text(
'${events.length}',
eventNum,
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 12.0,
@@ -266,6 +261,20 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
);
}
//Logic on if Home or Away return the colors
Color _gameTypeColor(String gameType, bool main){
Color c;
if (gameType == "H"){
c = Color.fromRGBO(0, 112, 60, 1); //UNCC Green
} else {
c = Colors.grey;
}
if (!main){
c = Colors.black45;//Color.fromRGBO(179, 163, 105, 1);
}
return c;
}
//----- Creates event display -----
Widget _eventLister() {
return ListView(
@@ -285,7 +294,7 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
child: ListTile(
leading: Image.network(
'https://charlotte49ers.com' + event.image.toString(),
width: 50.0,
width: 35.0,
),
title: Wrap(
children: <Widget>[
@@ -317,13 +326,11 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
subtitle: Text(
event.sportTitle.toString() + " - " + event.location.toString(),
style: TextStyle(
fontSize: 10.3,
fontSize: 9.9, //10.3
),
),
trailing: Wrap(
//mainAxisSize: MainAxisSize.min,
children: <Widget>[
//---Score---
//Game hasn't occured

View File

@@ -18,7 +18,7 @@ class Feed {
class HorizontalNewsFeed extends StatelessWidget {
final Feed newsFeed;
final Widget title;
final Text title;
final double numCards;
const HorizontalNewsFeed({
@@ -31,9 +31,9 @@ class HorizontalNewsFeed extends StatelessWidget {
double heightIn(BuildContext context) {
return MediaQuery.of(context).size.height / numCards;
}
@override
Widget build(BuildContext context) {
//print(title.data);
return SizedBox(
height: heightIn(context),
child: Column(
@@ -43,8 +43,8 @@ class HorizontalNewsFeed extends StatelessWidget {
title: title,
trailing: IconButton(
icon: Icon(Icons.navigate_next),
onPressed: () => Navigator.of(context).pushNamed('/Sport', arguments: title.data),
onPressed: () => Navigator.of(context).pushNamed('/Sport'),
/*onPressed: () { //changed
Navigator.of(context).pushNamed('/Sport');

View File

@@ -12,15 +12,15 @@ class RouteGenerator {
static Route<dynamic> generateRoute(RouteSettings settings) {
final args = settings
.arguments; //This is how we pass arguments and can be used in case
print("args $args");
switch (settings.name) {
case '/':
return MaterialPageRoute(builder: (_) => Home());
case '/Sport':
//We can put logic and stuff here for checking if logged in
return MaterialPageRoute(builder: (_) => Sport());
return MaterialPageRoute(builder: (_) => Sport(args));
case '/Schedule':
return MaterialPageRoute(builder: (_) => Schedule());
return MaterialPageRoute(builder: (_) => Schedule(args));
case '/Standing':
return MaterialPageRoute(builder: (_) => Standing());
case '/Chat':

View File

@@ -3,15 +3,17 @@ import '../monthly_calendar.dart';
class Schedule extends StatelessWidget{
final calendar = Calendar();
final List sport;
Schedule(this.sport);
@override
Widget build(BuildContext context) {
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 (

View File

@@ -4,27 +4,43 @@ import '../news/feed.dart';
class Sport 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),
const Item('Football', Colors.green,[3]),
const Item("Basketball", Colors.red,[5,13]),
const Item("Soccer", Colors.pinkAccent,[9,17]),
const Item('Baseball', Colors.orange,[1]),
const Item('Softball', Colors.yellow,[12]),
const Item('Volleyball', Colors.blue,[20]),
const Item('Tennis', Colors.yellowAccent,[10,18]),
];
Item _curSport = colorList[0];
final feed = Feed(); // was var not final
bool genderSportSwitch = false; //determines if sport needs the gender switch
final String imageMale = 'images/male.png';
final String imageFemale = 'images/female.png';
static bool genderSport = false; //determines which gender switch is set M - false / F - True
static int sport_ID;
final String sport;
Sport(this.sport);
Item _curSport = colorList[0];
@override
Widget build(BuildContext context) {
Item _setDefault(){
Item _curSport;
for (Item i in colorList){
if (i.name == sport){
_curSport = i;
break;
}
}
return _curSport;
}
_curSport = _setDefault();
sport_ID = _curSport.sportID[0];
Item selectedSport;
_genderSwitcherCheck();
return StatefulBuilder(
builder: (context, StateSetter setState) => Scaffold(
appBar: AppBar(
@@ -32,22 +48,15 @@ class Sport extends StatelessWidget {
title: buildDropdownButton(selectedSport, setState),
backgroundColor: _curSport.color,
//--Gender Switch-- Need to make condition to determine gender
//--Gender Switch--
actions: <Widget>[
if (genderSportSwitch == true)
if (genderSportSwitch)
Switch(
value: genderSport,
onChanged: (value) {
setState(() {
if (value == false) {
genderSport = false;
}
else {
genderSport = true;
}
print("value: " + value.toString());
print("gender: " + genderSport.toString());
genderSport = value;
_genderSwitcherCheck();
});
},
inactiveThumbColor: Colors.lightBlue,
@@ -90,13 +99,13 @@ class Sport extends StatelessWidget {
ListTile(
title: IconButton(
icon: Icon(Icons.table_chart),
onPressed: () => Navigator.pushNamed(context, '/Standing'),
onPressed: () => Navigator.pushNamed(context, '/Standing', arguments: sport_ID),
),
),
ListTile(
title: IconButton(
icon: Icon(Icons.calendar_today),
onPressed: () => Navigator.pushNamed(context, '/Schedule'),
onPressed: () => Navigator.pushNamed(context, '/Schedule',arguments: [sport_ID, _curSport.name],),
),
),
],
@@ -106,8 +115,7 @@ class Sport extends StatelessWidget {
);
}
DropdownButtonHideUnderline buildDropdownButton(
Item selectedSport, StateSetter setState) {
DropdownButtonHideUnderline buildDropdownButton(Item selectedSport, StateSetter setState) {
return DropdownButtonHideUnderline(
child: DropdownButton<Item>(
value: selectedSport,
@@ -123,44 +131,7 @@ class Sport extends StatelessWidget {
onChanged: (Item value) {
setState(() {
_curSport = value;
print("genderSport: " + genderSport.toString());
//Will set the sport id / Display gender switch
switch (_curSport.name) { //prints are temp
case 'FootBall':
genderSportSwitch = false;
sport_ID = 3;
break;
case 'BasketBall':
genderSportSwitch = true;
if (genderSport == false) {
sport_ID = 5; //Male
}
else {
sport_ID = 13; //Female
}
break;
case 'Soccer':
genderSportSwitch = true;
if (genderSport == false) {
sport_ID = 9; //Male
}
else {
sport_ID = 17; //Female
}
break;
case 'Baseball':
genderSportSwitch = false;
sport_ID = 1;
break;
}
_genderSwitcherCheck();
print(sport_ID);
});
},
@@ -176,11 +147,25 @@ class Sport extends StatelessWidget {
),
);
}
void _genderSwitcherCheck() {
if (_curSport.name == "Soccer" || _curSport.name == "Basketball" || _curSport.name == "Tennis" ){
genderSportSwitch = true;
sport_ID = genderSport ? _curSport.sportID[1] : _curSport.sportID[0];
} else {
genderSportSwitch = false;
sport_ID = _curSport.sportID[0];
}
print(sport_ID);
}
}
class Item {
const Item(this.name, this.color);
const Item(this.name, this.color, this.sportID);
final String name;
final Color color;
}
final List<int> sportID;
}

View File

@@ -7,21 +7,21 @@ packages:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
version: "2.0.11"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.0"
version: "1.5.2"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
version: "2.4.0"
bloc:
dependency: transitive
description:
@@ -35,21 +35,21 @@ packages:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "1.0.5"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
version: "1.1.2"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.12"
version: "1.14.11"
convert:
dependency: transitive
description:
@@ -63,7 +63,7 @@ packages:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
version: "2.1.3"
cupertino_icons:
dependency: "direct main"
description:
@@ -113,7 +113,7 @@ packages:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.12"
version: "2.1.4"
intl:
dependency: transitive
description:
@@ -176,7 +176,7 @@ packages:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.0.5"
rxdart:
dependency: transitive
description:
@@ -230,7 +230,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.5.5"
stack_trace:
dependency: transitive
description:
@@ -272,7 +272,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:
@@ -293,7 +293,7 @@ packages:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.1"
version: "3.5.0"
sdks:
dart: ">=2.6.0 <3.0.0"
flutter: ">=1.12.13+hotfix.4 <2.0.0"