3 Commits

Author SHA1 Message Date
Bnice2max
bfe79ac367 Merge branch 'master' into Max
updating Max branch things
2020-02-27 18:45:52 -05:00
Bnice2max
c89530ca56 saved comment details 2020-02-21 15:02:45 -05:00
Bnice2max
96ecdc3876 storing hello world changes 2020-02-07 15:00:27 -05:00
42 changed files with 126 additions and 1955 deletions

3
android/.gitignore vendored
View File

@@ -5,6 +5,3 @@ gradle-wrapper.jar
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
/android/app/src/debug/gen
/android/app/src/main/gen
/android/app/src/profile/gen

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -1,2 +1 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"

View File

@@ -1,2 +1 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"

View File

@@ -9,11 +9,14 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
A3EB31443D013642540B39CB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AFA6FFA8DD670B24F233CFA /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -23,6 +26,8 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
@@ -32,16 +37,14 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
2AFA6FFA8DD670B24F233CFA /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2BA468F01A093BC5197E02A7 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
650D60F5EF8D34D8E09E474E /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
8254A0F7600F16C78FD108C7 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -54,28 +57,20 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A3EB31443D013642540B39CB /* Pods_Runner.framework in Frameworks */,
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
64E35ED21045FF8D7525F43B /* Pods */ = {
isa = PBXGroup;
children = (
2BA468F01A093BC5197E02A7 /* Pods-Runner.debug.xcconfig */,
650D60F5EF8D34D8E09E474E /* Pods-Runner.release.xcconfig */,
8254A0F7600F16C78FD108C7 /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
@@ -89,8 +84,6 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
64E35ED21045FF8D7525F43B /* Pods */,
BC88384DE96E3913225BBCFC /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -125,14 +118,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
BC88384DE96E3913225BBCFC /* Frameworks */ = {
isa = PBXGroup;
children = (
2AFA6FFA8DD670B24F233CFA /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -140,14 +125,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
D5608DCB02383A1E5233B166 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
1255276F7F24303C431FF6EC /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -169,7 +152,6 @@
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = W5P374VFZT;
LastSwiftMigration = 1100;
};
};
@@ -207,21 +189,6 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
1255276F7F24303C431FF6EC /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -234,7 +201,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
@@ -250,28 +217,6 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
D5608DCB02383A1E5233B166 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -364,7 +309,6 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = W5P374VFZT;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -500,7 +444,6 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = W5P374VFZT;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -529,7 +472,6 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = W5P374VFZT;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",

View File

@@ -4,7 +4,4 @@
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

91
lib/home_widget.dart Normal file
View File

@@ -0,0 +1,91 @@
import 'package:flutter/material.dart';
import 'news/feed.dart';
class Home extends StatelessWidget {
final List<Object> _curSport = ['FootBall', Colors.green];
final List<Item> colorList = <Item>[
const Item("FootBall", Colors.red),
const Item("Soccer", Colors.pinkAccent),
const Item('Baseball', Colors.yellow),
];
var feed = Feed();
@override
Widget build(BuildContext context) {
int _currentBodyIndex = 0;
Item selectedSport;
return StatefulBuilder(
builder: (context, StateSetter setState) => Scaffold(
appBar: AppBar(
centerTitle: true,
title: DropdownButton<Item>(
value: selectedSport,
icon: Icon(Icons.arrow_drop_down),
iconSize: 24,
style: TextStyle(color: Colors.black),
iconEnabledColor: Colors.white,
onChanged: (Item value) {
setState(() {
selectedSport = value;
_curSport[0] = selectedSport.name;
_curSport[1] = selectedSport.color;
});
},
items: colorList.map<DropdownMenuItem<Item>>((Item item) {
return DropdownMenuItem<Item>(
value: item,
child: SizedBox(
width: 100,
child: Text(item.name),
),
);
}).toList(),
),
backgroundColor: _curSport[1],
),
body: ListView(
children: <Widget>[
HorizontalNewsFeed(newsFeed: feed, title: Text("Basketball")),
HorizontalNewsFeed(newsFeed: feed, title: Text("Soccer")),
HorizontalNewsFeed(newsFeed: feed, title: Text("Football")),
HorizontalNewsFeed(newsFeed: feed, title: Text("Volleyball")),
],
),
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
onTap: (int index) {
setState(() {
_currentBodyIndex = index;
});
},
currentIndex: _currentBodyIndex,
items: [
BottomNavigationBarItem(
icon: new Icon(Icons.home),
title: new Text("Home"),
),
BottomNavigationBarItem(
icon: new Icon(Icons.calendar_today),
title: new Text("Schedule")),
BottomNavigationBarItem(
icon: new Icon(Icons.table_chart), title: new Text("Scores")),
BottomNavigationBarItem(
icon: new Icon(Icons.assessment), title: new Text("Standings")),
BottomNavigationBarItem(
icon: new Icon(Icons.more_horiz), title: new Text("More"))
],
),
),
);
}
}
class Item {
const Item(this.name, this.color);
final String name;
final Color color;
}

View File

@@ -1,15 +1,24 @@
import 'package:capstone_hungry_hippos/route_generator.dart';
import 'package:flutter/material.dart';
import 'home_widget.dart';
void main() => runApp(App());
class App extends StatelessWidget {
class App extends StatelessWidget{
@override
Widget build(BuildContext context) {
return MaterialApp(
/* title: 'UNCC Sports app Demo',
theme: ThemeData(
primaryColor: Colors.lightGreen.shade900,
accentColor: Colors.yellow.shade600,
),
home: MyHomePage(title: 'UNCC Sports Demo Home Page'),*/
debugShowCheckedModeBanner: false,
initialRoute: '/',
onGenerateRoute: RouteGenerator.generateRoute,
title: 'UNCC Athletics',
home: Home(),
);
}
}

View File

@@ -1,16 +0,0 @@
import 'package:flutter/material.dart';
class School {
final String name;
final AssetImage logo;
final int win;
final int loss;
School(
this.name,
this.logo,
this.win,
this.loss
);
}

View File

@@ -1,385 +0,0 @@
import 'package:flutter/material.dart';
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 {
@override
_Calendar createState() => _Calendar();
}
//List<sport_schedule> _selectedEvents; //original that makes events work
List _selectedEvents; //Removing the <sport_schedule> allows it to still work. Proceed with caution
DateTime selectedDay;
Map<DateTime, List<sport_schedule>> _events;
class _Calendar extends State<Calendar> with TickerProviderStateMixin {
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';
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 {
Map<DateTime, List<sport_schedule>> mapGrab = {};
List<sport_schedule> eventInfo = await getEvents();
for (int i = 0; i < eventInfo.length; i++) {
var sportEvent = DateTime(
eventInfo[i].date.year,
eventInfo[i].date.month,
eventInfo[i].date.day
);
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]]);
}
}
return mapGrab;
}
@override
void initState() {
final _selectedDay = DateTime.now();
//_selectedEvents = _events[_selectedDay] ?? [];
_selectedEvents = [];
_calController = CalendarController();
_animationController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 400),
);
_animationController.forward();
WidgetsBinding.instance.addPostFrameCallback((_) {
getGames().then((val) => setState(() {
_events = val;
}));
});
super.initState();
}
@override
void dispose() {
_animationController.dispose();
_calController.dispose();
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
setState(() {
_selectedEvents = events;
selectedDay = DateTime(day.year, day.month, day.day);
});
}
/*void _onVisibleDaysChanged(DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onVisibleDaysChanged');
}
void _onCalendarCreated(DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onCalendarCreated');
}*/
//----- Builds calendar and event Lister -----
@override
Widget build(BuildContext context) {
return Center(
child: Column(
children: <Widget>[
_buildCalendar(),
const SizedBox(height: 8.0),
Expanded(child: _eventLister()),
],
),
);
}
//----- Builds calendar -----
@override
Widget _buildCalendar() {
return TableCalendar(
calendarController: _calController,
initialCalendarFormat: CalendarFormat.month,
startingDayOfWeek: StartingDayOfWeek.sunday,
//availableGestures: AvailableGestures.all,
events: _events,
availableCalendarFormats: const {
CalendarFormat.month: '',
},
calendarStyle: CalendarStyle(
outsideWeekendStyle: TextStyle(
color: Colors.grey,
),
weekendStyle: TextStyle(
color: Colors.black,
),
),
daysOfWeekStyle: DaysOfWeekStyle(
weekendStyle: TextStyle(
color: Colors.black,
),
weekdayStyle: TextStyle(
color: Colors.black,
),
),
headerStyle: HeaderStyle(
centerHeaderTitle: true,
formatButtonVisible: false, //hides button that formats between 1 week, 2 week, month
//formatButtonShowsNext: false,
),
builders: CalendarBuilders(
selectedDayBuilder: (context, date, _) {
return Container(
margin: const EdgeInsets.all(4.0),
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border.all(
color: Color.fromRGBO(0, 112, 60, 1), //UNCC Green
),
color: Color.fromRGBO(179, 163, 105, 1), //UNCC Gold
borderRadius: BorderRadius.circular(10.0)
),
child: Text(
'${date.day}',
style: TextStyle(color: Colors.white),
),
);
},
todayDayBuilder: (context, date, _) {
return Container(
margin: const EdgeInsets.all(4.0),
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border.all(
color: Color.fromRGBO(0, 112, 60, 1), //UNCC Green
),
borderRadius: BorderRadius.circular(10.0)
),
child: Text(
'${date.day}',
style: TextStyle(
color: Colors.black,
),
),
);
},
markersBuilder: (context, date, events, holidays) {
final miniBox = <Widget>[];
if (events.isNotEmpty) {
miniBox.add(
Positioned(
right: 1,
bottom: 1,
child: _buildEventsMarker(date, events),
),
);
}
return miniBox;
},
),
onDaySelected: (date, events) {
_DaySelected(date, events);
_animationController.forward(from: 0.0);
},
//onVisibleDaysChanged: _onVisibleDaysChanged,
//onCalendarCreated: _onCalendarCreated,
);
}
//----- Creates event box display (mini box) -----
Widget _buildEventsMarker(DateTime date, List events) {
return AnimatedContainer(
duration: const Duration(milliseconds: 300),
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,
),
width: 16.0,
height: 16.0,
child: Center(
child: Text(
'${events.length}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 12.0,
),
),
),
);
}
//----- Creates event display -----
Widget _eventLister() {
return ListView(
children: _selectedEvents.map((event) => Container(
decoration: BoxDecoration(
border: Border.all(
color: Color.fromRGBO(0, 112, 60, 1), //UNCC Green
width: 0.8,
),
borderRadius: BorderRadius.circular(12.0),
),
height: 70.0,
margin: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
child: ListTile(
leading: Image.network(
'https://charlotte49ers.com' + event.image.toString(),
width: 50.0,
),
title: Wrap(
children: <Widget>[
if (event.location_indicator.toString() == "H")
Text(
'vs. ',
style: TextStyle( //home game
fontSize: 11.6,
),
)
else
Text(
'at ',
style: TextStyle( //away game
fontSize: 11.6,
),
),
Text(
event.opponentTitle.toString(),
style: TextStyle(
fontSize: 11.6,
),
) //opponent name
],
),
//Type of sport - Location
subtitle: Text(
event.sportTitle.toString() + " - " + event.location.toString(),
style: TextStyle(
fontSize: 10.3,
),
),
trailing: Wrap(
//mainAxisSize: MainAxisSize.min,
children: <Widget>[
//---Score---
//Game hasn't occured
if (event.status.toString() == "null")
Text("TBD"),
//---Scores---
if (event.status.toString() == "W" || event.status.toString() == "L" || event.status.toString() == "T") //Finished games
Text(event.team_score.toString() + " - " + event.opponent_score.toString() + " ")
else if (event.status.toString() == "N" && event.team_score.toString() != "null" && event.opponent_score.toString() != "null") //Games that don't count
Text(event.team_score.toString() + " - " + event.opponent_score.toString() + " "),
//---Game Status---
if (event.status.toString() == "W") //Win
Text(
(" " + event.status.toString() + " "),
style: TextStyle(
color: Colors.white,
backgroundColor: Color.fromRGBO(0, 112, 60, 1),
)
),
if (event.status.toString() == "L" || event.status.toString() == "T") //Lose-Tie
Text(
(" " + event.status.toString() + " "),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
backgroundColor: Colors.grey,
)
),
if (event.status.toString() == "N" && event.postscore.toString() != "Canceled") //N
Text(
(" " + event.status.toString() + " "),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
backgroundColor: Colors.grey,
)
)
else if (event.team_score.toString() == "null" && event.opponent_score.toString() == "null"
&& event.status.toString() == "N") //Game was canceled
Text(
"Canceled",
style: TextStyle(
color: Colors.red,
)
),
],
),
onTap: () => print('$event tapped!'), //When event display is clicked
),
)).toList(),
);
}
}

View File

@@ -76,7 +76,6 @@ class ArticleCard extends StatelessWidget {
],
);
return SizedBox(
width: widthIn(context),
child: Card(

View File

@@ -43,14 +43,7 @@ class HorizontalNewsFeed extends StatelessWidget {
title: title,
trailing: IconButton(
icon: Icon(Icons.navigate_next),
onPressed: () => Navigator.of(context).pushNamed('/Sport'),
/*onPressed: () { //changed
Navigator.of(context).pushNamed('/Sport');
print(Navigator.of(context).pushNamed('/Sport'));
}*/
onPressed: () {},
),
),
Expanded(

View File

@@ -1,63 +0,0 @@
import 'package:capstone_hungry_hippos/screens/chat.dart';
import 'package:capstone_hungry_hippos/screens/schedule.dart';
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/twitter_widget.dart';
import 'package:capstone_hungry_hippos/screens/favorites_reorder.dart';
import 'package:capstone_hungry_hippos/screens/game_details.dart';
class RouteGenerator {
static Route<dynamic> generateRoute(RouteSettings settings) {
final args = settings
.arguments; //This is how we pass arguments and can be used in case
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());
case '/Schedule':
return MaterialPageRoute(builder: (_) => Schedule());
case '/Standing':
return MaterialPageRoute(builder: (_) => Standing());
case '/Chat':
return MaterialPageRoute(builder: (_) => Chat());
case '/Details':
return MaterialPageRoute(builder: (_) => Details());
case '/Favorites':
return MaterialPageRoute(builder: (_) => FavoritesManager());
case '/Twitter':
return MaterialPageRoute(builder: (_) => TwitterFeed());
default:
return _errorRoute();
}
}
static Route _errorRoute() {
return MaterialPageRoute(builder: (_) {
return Scaffold(
appBar: AppBar(
title: Text("Error Page"),
),
body: Center(
child: Text("Error Page"),
),
drawer: Drawer(
child: ListView(
children: <Widget>[
ListTile(
title: IconButton(
icon: Icon(Icons.home),
onPressed: () => Navigator.pushNamed(_, '/'),
),
),
],
),
),
);
});
}
}

View File

@@ -1,40 +0,0 @@
import 'package:flutter/material.dart';
class Chat extends StatelessWidget{
@override
Widget build(BuildContext context) {
return StatefulBuilder(
builder: (context, StateSetter setState) => Scaffold(
appBar: AppBar(
centerTitle: false,
title: Text("49ers"),
backgroundColor: Colors.green,
),
body: 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, '/'),
),
),
],
),
)
));
}
}

View File

@@ -1,82 +0,0 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
class Favorites {
Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
static const List<String> DEFAULT_FAVORITES = [
'Football',
'Basketball',
'Baseball',
'Soccer',
'Tennis',
'Volleyball'
];
Future<List<String>> get_favorites() async {
final prefs = await _prefs;
return prefs.getStringList('favorites') ?? DEFAULT_FAVORITES;
}
Future<bool> set_favorites(final List<String> favorites) async {
final prefs = await _prefs;
return await prefs.setStringList('favorites', favorites);
}
}
class FavoritesManager extends StatefulWidget {
FavoritesManager({Key key}) : super(key: key);
@override
_FavoritesManagerState createState() => _FavoritesManagerState();
}
class _FavoritesManagerState extends State<FavoritesManager> {
Favorites _mgr = Favorites();
Future<List<String>> _order;
@override
void initState() {
_order = _mgr.get_favorites();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: false,
title: Text('Manage Favorites'),
backgroundColor: Colors.green,
),
body: FutureBuilder<List<String>>(
future: _order,
builder: (ctx, snap) {
if (snap.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator();
} else {
var order = snap.data.toList();
return ReorderableListView(
onReorder: (int oldIdx, int newIdx) {
if (newIdx > oldIdx) newIdx--;
order.insert(newIdx, order.removeAt(oldIdx));
setState(() {
_mgr.set_favorites(order);
_order = Future.value(order);
});
},
children: order.map((sport) {
return ListTile(
key: Key(sport),
title: Text(sport),
trailing: Icon(Icons.drag_handle),
);
}).toList(),
);
}
},
),
);
}
}

View File

@@ -1,332 +0,0 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'dart:io';
class Details 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),
];
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: Container(
color: Colors.black12,
child: Column(
children: <Widget>[
Container(
color: Colors.black12,
child: Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(
color: Colors.black,
width: 2.0,
),
),
),
child: Padding(
padding: EdgeInsets.symmetric(vertical: 20.0, horizontal: 30.0),
child: Row(
children: <Widget>[
Padding(
padding: EdgeInsets.only(right: 5),
child: Column(
children: <Widget>[
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('10',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)
),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 25),
child: Text('vs',
style: TextStyle(
decoration: TextDecoration.underline,
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 25),
child: Text('52',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
),
Padding(
padding: EdgeInsets.only(left: 5),
child: Column(
children: <Widget>[
SizedBox(
width: 50,
height: 50,
child: Image.network('https://www.clemson.edu/brand/resources/logos/paw/orange.png'),
),
Text('Clemson',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
],
),
),
],
),
),
),
),
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,
),
),
),
child: Padding(
padding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 5.0),
child: Row(
children: <Widget>[
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: 50,
height: 30,
child: Center(
child: Text('Chat',
style: TextStyle(fontSize: 16),
),
),
),
),
),
],
),
),
),
),
Container(
child: GameUpdates(),
),
],
),
),
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, '/'),
),
),
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;
}
class Play {
final String title;
final String action;
Play(
this.title,
this.action,
);
}
class GameUpdates extends StatelessWidget{
List<Play> 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<int>.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: myList.length,
itemBuilder: (context, int index){
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}'),
),
),
),
);
}
),
),
);
}
}

View File

@@ -1,101 +0,0 @@
import 'package:capstone_hungry_hippos/screens/favorites_reorder.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../news/feed.dart';
class Home extends StatefulWidget {
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: FutureBuilder(
future: _buildList(),
builder: (ctx, snap) {
if (snap.hasData) {
return CustomScrollView(
slivers: <Widget>[
_AppBar(),
SliverList(delegate: SliverChildListDelegate(snap.data)),
],
);
} else {
return CircularProgressIndicator();
}
},
),
drawer: Drawer(
child: ListView(
children: <Widget>[
DrawerHeader(
child: Text(
'Drawer Header',
style: TextStyle(
color: Colors.white,
fontSize: 28,
),
),
decoration: BoxDecoration(
color: Colors.green,
),
),
ListTile(
title: IconButton(
icon: Icon(Icons.message),
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'),
),
),
ListTile(
title: IconButton(
icon: Icon(Icons.voice_chat),
onPressed: () => Navigator.pushNamed(context, '/Twitter'),
),
),
ListTile(
title: IconButton(
icon: Icon(Icons.settings),
onPressed: () =>
Navigator.pushNamed(context, '/Favorites').then((e) {
setState(() {});
}),
),
)
],
),
),
);
}
}
class _AppBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SliverAppBar(
centerTitle: false,
title: Text("49ers"),
backgroundColor: Colors.green,
);
}
}
Future<List<HorizontalNewsFeed>> _buildList() async {
final feed = Feed();
final mgr = Favorites();
final sports = await mgr.get_favorites();
return sports.map((sport) {
return HorizontalNewsFeed(
newsFeed: feed,
title: Text(sport),
);
}).toList();
}

View File

@@ -1,46 +0,0 @@
import 'package:flutter/material.dart';
import '../monthly_calendar.dart';
class Schedule extends StatelessWidget{
final calendar = Calendar();
@override
Widget build(BuildContext context) {
return StatefulBuilder(
builder: (context, StateSetter setState) => Scaffold(
appBar: AppBar(
centerTitle: false,
title: Text("49ers"),
backgroundColor: Colors.green,
),
body: Container (
child: calendar,
),
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, '/'),
),
),
],
),
)
));
}
}

View File

@@ -1,186 +0,0 @@
import 'package:flutter/material.dart';
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),
];
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;
@override
Widget build(BuildContext context) {
Item selectedSport;
return StatefulBuilder(
builder: (context, StateSetter setState) => Scaffold(
appBar: AppBar(
centerTitle: false,
title: buildDropdownButton(selectedSport, setState),
backgroundColor: _curSport.color,
//--Gender Switch-- Need to make condition to determine gender
actions: <Widget>[
if (genderSportSwitch == true)
Switch(
value: genderSport,
onChanged: (value) {
setState(() {
if (value == false) {
genderSport = false;
}
else {
genderSport = true;
}
print("value: " + value.toString());
print("gender: " + genderSport.toString());
});
},
inactiveThumbColor: Colors.lightBlue,
inactiveThumbImage: Image.asset(imageMale).image,
activeColor: Colors.pinkAccent,
activeThumbImage: Image.asset(imageFemale).image,
),
]
),
body: ListView(
children: <Widget>[
HorizontalNewsFeed(newsFeed: feed, title: Text(_curSport.name)),
HorizontalNewsFeed(newsFeed: feed, title: Text(_curSport.name)),
HorizontalNewsFeed(newsFeed: feed, title: Text(_curSport.name)),
HorizontalNewsFeed(newsFeed: feed, title: Text(_curSport.name)),
],
),
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, '/'),
),
),
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'),
),
),
],
),
),
),
);
}
DropdownButtonHideUnderline buildDropdownButton(
Item selectedSport, StateSetter setState) {
return DropdownButtonHideUnderline(
child: DropdownButton<Item>(
value: selectedSport,
icon: Icon(Icons.arrow_drop_down),
iconSize: 28,
style: TextStyle(color: Colors.black, fontSize: 28),
iconEnabledColor: Colors.white,
hint: Text(
_curSport.name,
style: TextStyle(
color: Colors.white, fontSize: 28, fontWeight: FontWeight.bold),
),
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;
}
print(sport_ID);
});
},
items: colorList.map<DropdownMenuItem<Item>>((Item item) {
return DropdownMenuItem<Item>(
value: item,
child: SizedBox(
child: Text(item.name),
width: 150,
),
);
}).toList(),
),
);
}
}
class Item {
const Item(this.name, this.color);
final String name;
final Color color;
}

View File

@@ -1,64 +0,0 @@
import 'package:flutter/material.dart';
class sport_schedule {
final int id; //id for each game
final DateTime date; //date: 2020-09-05T00:00:00
final String location_indicator; //location_indicator: H-Home / A-Away
final String location; //location: Knoxville, Tenn., Charlotte, NC
// -- sport json --
final int idSport; //id: Each sport different number
final String sportTitle; //title: Football, Men's Soccer
final String gender; //gender: M - F
// -- opponent json --
final String opponentTitle; //title: Tennessee, Norfolk State
final String image;
// -- result json --
final String status; //status: W - T - L
final String team_score; //team_score:
final String opponent_score; //opponent_score:
final String postscore;
sport_schedule(
this.id, {
this.date,
this.location_indicator,
this.location,
this.idSport,
this.sportTitle,
this.gender,
this.opponentTitle,
this.image,
this.status,
this.team_score,
this.opponent_score,
this.postscore,
});
factory sport_schedule.fromJson(Map<String, dynamic> json) {
return sport_schedule(
json['id'],
date: DateTime.parse(json['date']),
location_indicator: json['location_indicator'],
location: json['location'],
idSport: json['sport']['id'],
sportTitle: json['sport']['title'],
gender: json['sport']['gender'],
opponentTitle: json['opponent']['title'],
image: json['opponent']['image'],
status: json['result']['status'],
team_score: json['result']['team_score'],
opponent_score: json['result']['opponent_score'],
postscore: json['result']['postscore'],
);
}
}

View File

@@ -1,171 +0,0 @@
import 'package:capstone_hungry_hippos/models/School.dart';
import 'package:flutter/material.dart';
class Standing extends StatelessWidget {
final _schools = [
School("North Texas Mean Green",AssetImage('assets/school_logos/NorthTexas.png'), 14, 4),
School("Louisiana Tech Bulldogs",AssetImage('assets/school_logos/LT.png'), 13, 5),
School("Western Kentucky Hilltoppers",AssetImage('assets/school_logos/wku.png'), 13, 5),
School("Charlotte 49ers",AssetImage('assets/school_logos/uncc.png'), 10, 8),
School("Marshall Thundering Herd",AssetImage('assets/school_logos/Marshall.png'), 10, 8),
School("Florida Int'L Panthers",AssetImage('assets/school_logos/FIU.png'), 9, 9),
School("UAB Blazers",AssetImage('assets/school_logos/UAB.png'), 9, 9),
School("Old Dominion Monarchs",AssetImage('assets/school_logos/ODU.png'), 9, 9),
School("Florida Atlantic Owl",AssetImage('assets/school_logos/FAU.png'), 8, 10),
School("UTEP Miners",AssetImage('assets/school_logos/UTEP.png'), 8, 10),
School("UTSA Roadrunners",AssetImage('assets/school_logos/UTSA.png'), 7, 11),
School("Rice Owls",AssetImage('assets/school_logos/RiceOwls.png'), 7, 11),
School("Southern Miss Golden Eagles",AssetImage('assets/school_logos/SouthernMiss.png'), 5, 13),
School("Middle Tennessee Blue Raiders",AssetImage('assets/school_logos/MT.png'), 4, 14),
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: false,
title: Text("49ers"),
backgroundColor: Colors.green,
),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
Container(
child: Text(
"W L",
style: TextStyle(fontWeight: FontWeight.bold),
),
alignment: Alignment(.85, 0),
height: 20,
color: Colors.grey,
),
SportLine(
s: _schools[0],
position: 1,
),
SportLine(
s: _schools[1],
position: 2,
),
SportLine(
s: _schools[2],
position: 3,
),
SportLine(
s: _schools[3],
position: 4,
),
SportLine(
s: _schools[4],
position: 5,
),
SportLine(
s: _schools[5],
position: 6,
),
SportLine(
s: _schools[6],
position: 7,
),
SportLine(
s: _schools[7],
position: 8,
),
SportLine(
s: _schools[8],
position: 9,
),
SportLine(
s: _schools[9],
position: 10,
),
SportLine(
s: _schools[10],
position: 11,
),
SportLine(
s: _schools[11],
position: 12,
),SportLine(
s: _schools[12],
position: 13,
),SportLine(
s: _schools[13],
position: 14,
),
],
),
),
);
}
}
class SportLine extends StatelessWidget {
const SportLine({
Key key,
@required
this.position,
this.s
}) : super(key: key);
final School s;
final int position;
@override
Widget build(BuildContext context) {
int w = s.win;
int l = s.loss;
return Container(
color: evenOdd(position),
height: 60,
child: Row(
children: <Widget>[
Container(
height: 55,
width: 20,
//color: Colors.orange,
child: Center(
child: Text(
"$position",
style: TextStyle(fontWeight: FontWeight.bold),
)),
),
Container(
//color: Colors.blue,
width: 55,
child: Image(
image: s.logo,
),
),
Container(
width: 5,
//color: Colors.red,
),
Container(
//color: Colors.pinkAccent,
width: 220,
child: Text(s.name),
),
Container(
//color: Colors.orange,
width: 35,
child: Text(
"$w",
style: TextStyle(fontWeight: FontWeight.bold),
)),
Container(
//color: Colors.blue,
width: 35,
child: Text(
" $l",
style: TextStyle(fontWeight: FontWeight.bold),
))
],
)
);
}
Color evenOdd(int i) {
Color c = i % 2 == 0 ? Colors.black12 : Colors.white30;
return c;
}
}

View File

@@ -1,63 +0,0 @@
import 'package:capstone_hungry_hippos/twitter_assets/twitterFeed.dart';
import 'package:flutter/material.dart';
import '../twitter_assets/tweet.dart';
class TwitterFeed extends StatelessWidget{
@override
Widget build(BuildContext context) {
return StatefulBuilder(
builder: (context, StateSetter setState) => Scaffold(
appBar: AppBar(
centerTitle: false,
title: Text("49ers Tweets"),
backgroundColor: Colors.green,
),
body: Container(
color: Colors.black12,
child:
FutureBuilder(
future: _buildTwitter(),
builder: (ctx, snapshot){
if(!snapshot.hasData){
return Center(child: CircularProgressIndicator());
}else{
return snapshot.data;
}
},
),
),
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, '/'),
),
),
],
),
)
));
}
}
Future<VerticalTwitterFeed> _buildTwitter() async {
final feed = TwitterFeedCreation();
return VerticalTwitterFeed(twitterFeed: feed);
}

View File

@@ -1,69 +0,0 @@
import 'package:flutter/material.dart';
class Tweet {
final int id;
final String text;
//final String userName;
//final String userImgUrl;
//final String url;
Tweet(
this.id, {
this.text,
// this.userName,
// this.userImgUrl,
// this.url,
}
);
factory Tweet.fromJson(Map<String, dynamic> json) {
return Tweet(
json['id_str'],
text: json['full_text'],
//userName: json['user']['name'],
//userImgUrl: json['user']['profile_image_url_https'],
//url: json['urls']['expanded_url'],
);
}
}
class TwitterCard extends StatelessWidget{
const TwitterCard({
Key key,
@required this.tweet,
}) : super(key: key);
final Tweet tweet;
@override
Widget build(BuildContext context) {
return Card(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 0),
child: ListTile(
/* leading: SizedBox(
height: 150,
width: 75,
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
fit: BoxFit.fill,
image: NetworkImage('${tweet.userImgUrl}'),
),
),
),
), */
// title: Text('${tweet.userName}'),
title: Text('${tweet.text}'),
),
),
);
}
}

View File

@@ -1,121 +0,0 @@
import 'dart:io';
import 'package:capstone_hungry_hippos/screens/twitter_widget.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:twitter_api/twitter_api.dart';
import'package:crypto/crypto.dart';
import 'dart:convert';
import 'tweet.dart';
final twitterBase = 'https://api.twitter.com/1.1/search';
final _twitterOauth = new twitterApi(
consumerKey: "gsa3eHPVGK90dt6fgUC2ZSbTE",
consumerSecret: "rwEjykGOfapPLTVkWgedSCU8Eld130EEHFyu3W0Ye3fDcKj5V",
token: "910563313108574211-WynoAeUKJrnE6uXPv8vJGx4ITGS1ggG",
tokenSecret: "dWFYYbn6J1QTyV86femOdriX7MfMSANSjH3m48ZtEZUNW",
);
class TwitterFeedCreation {
Future<List<Tweet>> getPage() async {
var response = await _twitterOauth.getTwitterRequest(
"GET",
"/statuses/user_timeline.json",
options: {
"user_id": "19025957",
"screen_name": "TTCnotices",
"count": "20",
"trim_user": "true",
"tweet_mode": "extended",
}
);
Iterable tweets = json.decode(response.body);
print(tweets);
return tweets.map((e) => Tweet.fromJson(e)).toList();
}
}
String _getSig(String method, String base, List<String> sortedItems){
String param = '';
for (int i = 0; i < sortedItems.length; i++) {
if (i == 0) {
param = sortedItems[i];
} else {
param += '%${sortedItems[i]}';
}
}
String sig = '$method&${Uri.encodeComponent(base)}&${Uri.encodeComponent(param)}';
String key = '${Uri.encodeComponent("gsa3eHPVGK90dt6fgUC2ZSbTE")}&${Uri.encodeComponent("rwEjykGOfapPLTVkWgedSCU8Eld130EEHFyu3W0Ye3fDcKj5V")}';
var digest = Hmac(sha1, utf8.encode(key)).convert(utf8.encode(sig));
return base64.encode(digest.bytes);
}
class VerticalTwitterFeed extends StatelessWidget{
final TwitterFeedCreation twitterFeed;
const VerticalTwitterFeed({
Key key,
@required this.twitterFeed,
}) : super(key: key);
@override
Widget build(BuildContext context) {
/*
return Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
itemCount: twitterFeed.length,
itemBuilder: (ctx, idx){
return TwitterCard(
tweet: twitterFeed[idx],
);
},
),
); */
return Container(
child: FutureBuilder(
future: twitterFeed.getPage(),
builder: (ctx, snapshot){
if(!snapshot.hasData){
return Center(child: CircularProgressIndicator());
}else{
List<Tweet> tweets = snapshot.data;
return ListView.builder(
scrollDirection: Axis.vertical,
itemCount: tweets.length,
itemBuilder: (ctx, idx) {
return TwitterCard(
tweet: tweets[idx],
);
},
);
}
},
),
);
}
}

View File

@@ -22,13 +22,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
bloc:
dependency: transitive
description:
name: bloc
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
boolean_selector:
dependency: transitive
description:
@@ -58,7 +51,7 @@ packages:
source: hosted
version: "2.1.1"
crypto:
dependency: "direct main"
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
@@ -76,23 +69,11 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_bloc:
dependency: "direct main"
description:
name: flutter_bloc
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: "direct main"
description:
@@ -106,7 +87,7 @@ packages:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
version: "3.1.3"
image:
dependency: transitive
description:
@@ -114,13 +95,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
intl:
dependency: transitive
description:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
matcher:
dependency: transitive
description:
@@ -135,13 +109,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
nested:
dependency: transitive
description:
name: nested
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4"
path:
dependency: transitive
description:
@@ -163,13 +130,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
provider:
dependency: transitive
description:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.4"
quiver:
dependency: transitive
description:
@@ -177,48 +137,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
rxdart:
dependency: transitive
description:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.23.1"
shared_preferences:
dependency: "direct main"
description:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.6+3"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+6"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2+4"
simple_gesture_detector:
dependency: transitive
description:
name: simple_gesture_detector
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
sky_engine:
dependency: transitive
description: flutter
@@ -252,13 +170,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
table_calendar:
dependency: "direct main"
description:
name: table_calendar
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.3"
term_glyph:
dependency: transitive
description:
@@ -273,13 +184,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.11"
twitter_api:
dependency: "direct main"
description:
name: twitter_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
typed_data:
dependency: transitive
description:
@@ -302,5 +206,4 @@ packages:
source: hosted
version: "3.5.0"
sdks:
dart: ">=2.6.0 <3.0.0"
flutter: ">=1.12.13+hotfix.4 <2.0.0"
dart: ">=2.4.0 <3.0.0"

View File

@@ -14,28 +14,23 @@ description: A sports app for UNC-Charlotte 49ers
version: 1.0.0+1
environment:
#sdk: ">=2.1.0 <3.0.0"
sdk: ">=2.6.0 <3.0.0"
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_bloc: ^3.2.0
http: ^0.12.0+4
shared_preferences: ^0.5.6+3
twitter_api: ^0.1.2
crypto:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
table_calendar:
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
@@ -48,23 +43,9 @@ flutter:
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/school_logos/FIU.png
- assets/school_logos/FAU.png
- assets/school_logos/LT.png
- assets/school_logos/Marshall.png
- assets/school_logos/MT.png
- assets/school_logos/NorthTexas.png
- assets/school_logos/ODU.png
- assets/school_logos/RiceOwls.png
- assets/school_logos/SouthernMiss.png
- assets/school_logos/UAB.png
- assets/school_logos/uncc.png
- assets/school_logos/UTEP.png
- assets/school_logos/UTSA.png
- assets/school_logos/wku.png
- images/male.png
- images/female.png
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.