diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..0ee4a53 --- /dev/null +++ b/ios/Podfile @@ -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 diff --git a/ios/Podfile.lock b/ios/Podfile.lock new file mode 100644 index 0000000..f7203c7 --- /dev/null +++ b/ios/Podfile.lock @@ -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 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 226967c..f91fa61 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -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; diff --git a/lib/monthly_calendar.dart b/lib/monthly_calendar.dart index 649775f..0641a5a 100644 --- a/lib/monthly_calendar.dart +++ b/lib/monthly_calendar.dart @@ -27,7 +27,6 @@ class _Calendar extends State with TickerProviderStateMixin { static final sportUrl = 'https://charlotte49ers.com/services/adaptive_components.ashx?type=scoreboard&start=0&count=80'; - Future> getEvents() async { var url = '$sportUrl&sport_id=$sportID&name=&extra=%7B%7D'; @@ -54,10 +53,8 @@ class _Calendar extends State 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]]); } } @@ -240,30 +237,26 @@ class _Calendar extends State with TickerProviderStateMixin { } //----- Creates event box display (mini box) ----- - Widget _buildEventsMarker(DateTime date, String location, bool main, events) { - String s; - if (main) {s = "${date.day}";} else {s = "${events.length}";} + Widget _buildEventsMarker(DateTime date, String gameType, bool main, events) { + String eventNum; + if (main) {eventNum = "${date.day}";} else {eventNum = "${events.length}";} + //return Container( 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) - ? Color.fromRGBO(179, 163, 105, 1) - : _homeAwayColor(location, main), //UNCC Green - //: Colors.grey, + /*border: Border.all( + color: Color.fromRGBO(0, 112, 60, 1), //UNCC Green + //color: Colors.black, + ),*/ + 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, @@ -271,7 +264,7 @@ class _Calendar extends State with TickerProviderStateMixin { child: Center( child: Text( - s, + eventNum, style: TextStyle().copyWith( color: Colors.white, fontSize: 12.0, @@ -281,16 +274,11 @@ class _Calendar extends State with TickerProviderStateMixin { ); } - 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 - // if game says at its away - //print(i.location_indicator); - + //Logic on if Home or Away return the colors + Color _gameTypeColor(String gameType, bool main){ Color c; - if (location == "H"){ // could also be if(game == "H") or something - c = Color.fromRGBO(0, 112, 60, 1); + if (gameType == "H"){ + c = Color.fromRGBO(0, 112, 60, 1); //UNCC Green } else { c = Colors.grey; } @@ -300,7 +288,6 @@ class _Calendar extends State with TickerProviderStateMixin { return c; } - //----- Creates event display ----- Widget _eventLister() { return ListView(