Compare commits
4 Commits
UpdatingCa
...
Twitter_ap
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f819278368 | ||
|
|
68c7b5c5b3 | ||
|
|
764dda9ea6 | ||
|
|
c874d2d5c3 |
90
ios/Podfile
90
ios/Podfile
@@ -1,90 +0,0 @@
|
||||
# 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
|
||||
@@ -1,34 +0,0 @@
|
||||
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
|
||||
@@ -3,38 +3,34 @@ 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(sportID);
|
||||
_Calendar createState() => _Calendar();
|
||||
}
|
||||
|
||||
List _selectedEvents;
|
||||
//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 {
|
||||
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 {
|
||||
@@ -51,8 +47,10 @@ 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]]);
|
||||
}
|
||||
}
|
||||
@@ -61,6 +59,9 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
final _selectedDay = DateTime.now();
|
||||
|
||||
//_selectedEvents = _events[_selectedDay] ?? [];
|
||||
_selectedEvents = [];
|
||||
_calController = CalendarController();
|
||||
|
||||
@@ -87,7 +88,8 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _DaySelected(DateTime day, List events) {
|
||||
//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);
|
||||
@@ -122,6 +124,7 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
|
||||
calendarController: _calController,
|
||||
initialCalendarFormat: CalendarFormat.month,
|
||||
startingDayOfWeek: StartingDayOfWeek.sunday,
|
||||
//availableGestures: AvailableGestures.all,
|
||||
events: _events,
|
||||
|
||||
availableCalendarFormats: const {
|
||||
@@ -198,20 +201,15 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
|
||||
|
||||
markersBuilder: (context, date, events, holidays) {
|
||||
final miniBox = <Widget>[];
|
||||
|
||||
if (events.isNotEmpty) {
|
||||
miniBox.add(
|
||||
Positioned(
|
||||
right: 0,top: 0, left: 0, bottom: 0,
|
||||
child: _buildEventsMarker(date, events[0].location_indicator, true, events),
|
||||
right: 1,
|
||||
bottom: 1,
|
||||
child: _buildEventsMarker(date, events),
|
||||
),
|
||||
);
|
||||
if (events.length > 1)
|
||||
miniBox.add(
|
||||
Positioned(
|
||||
right: 1, bottom: 1,
|
||||
child: _buildEventsMarker(date, events[0].location_indicator, false, events),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return miniBox;
|
||||
@@ -230,20 +228,27 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
|
||||
}
|
||||
|
||||
//----- Creates event box display (mini box) -----
|
||||
Widget _buildEventsMarker(DateTime date, String gameType, bool main, events) {
|
||||
String eventNum;
|
||||
if (main) {eventNum = "${date.day}";} else {eventNum = "${events.length}";}
|
||||
Widget _buildEventsMarker(DateTime date, List events) {
|
||||
return AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
|
||||
margin: const EdgeInsets.all(4.0),
|
||||
alignment: Alignment.center,
|
||||
|
||||
decoration: BoxDecoration(
|
||||
color: _calController.isSelected(date)
|
||||
? Color.fromRGBO(179, 163, 105, 1) //UNCC Gold
|
||||
: _gameTypeColor(gameType, main), //UNCC Green
|
||||
borderRadius: BorderRadius.circular(10.0)
|
||||
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,
|
||||
@@ -251,7 +256,7 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
|
||||
|
||||
child: Center(
|
||||
child: Text(
|
||||
eventNum,
|
||||
'${events.length}',
|
||||
style: TextStyle().copyWith(
|
||||
color: Colors.white,
|
||||
fontSize: 12.0,
|
||||
@@ -261,20 +266,6 @@ 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(
|
||||
@@ -294,7 +285,7 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
|
||||
child: ListTile(
|
||||
leading: Image.network(
|
||||
'https://charlotte49ers.com' + event.image.toString(),
|
||||
width: 35.0,
|
||||
width: 50.0,
|
||||
),
|
||||
title: Wrap(
|
||||
children: <Widget>[
|
||||
@@ -326,11 +317,13 @@ class _Calendar extends State<Calendar> with TickerProviderStateMixin {
|
||||
subtitle: Text(
|
||||
event.sportTitle.toString() + " - " + event.location.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 9.9, //10.3
|
||||
fontSize: 10.3,
|
||||
),
|
||||
),
|
||||
|
||||
trailing: Wrap(
|
||||
//mainAxisSize: MainAxisSize.min,
|
||||
|
||||
children: <Widget>[
|
||||
//---Score---
|
||||
//Game hasn't occured
|
||||
|
||||
@@ -18,7 +18,7 @@ class Feed {
|
||||
|
||||
class HorizontalNewsFeed extends StatelessWidget {
|
||||
final Feed newsFeed;
|
||||
final Text title;
|
||||
final Widget 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');
|
||||
|
||||
@@ -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(args));
|
||||
return MaterialPageRoute(builder: (_) => Sport());
|
||||
case '/Schedule':
|
||||
return MaterialPageRoute(builder: (_) => Schedule(args));
|
||||
return MaterialPageRoute(builder: (_) => Schedule());
|
||||
case '/Standing':
|
||||
return MaterialPageRoute(builder: (_) => Standing());
|
||||
case '/Chat':
|
||||
|
||||
@@ -3,17 +3,15 @@ import '../monthly_calendar.dart';
|
||||
|
||||
class Schedule extends StatelessWidget{
|
||||
|
||||
final List sport;
|
||||
Schedule(this.sport);
|
||||
final calendar = Calendar();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var calendar = Calendar(sport[0]);
|
||||
return StatefulBuilder(
|
||||
builder: (context, StateSetter setState) => Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
title: Text("${sport[1]}"),
|
||||
title: Text("49ers"),
|
||||
backgroundColor: Colors.green,
|
||||
),
|
||||
body: Container (
|
||||
|
||||
@@ -4,43 +4,27 @@ import '../news/feed.dart';
|
||||
class Sport extends StatelessWidget {
|
||||
|
||||
static final List<Item> colorList = <Item>[
|
||||
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]),
|
||||
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;
|
||||
final String sport;
|
||||
Sport(this.sport);
|
||||
|
||||
Item _curSport = colorList[0];
|
||||
static int sport_ID;
|
||||
|
||||
@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(
|
||||
@@ -48,15 +32,22 @@ class Sport extends StatelessWidget {
|
||||
title: buildDropdownButton(selectedSport, setState),
|
||||
backgroundColor: _curSport.color,
|
||||
|
||||
//--Gender Switch--
|
||||
//--Gender Switch-- Need to make condition to determine gender
|
||||
actions: <Widget>[
|
||||
if (genderSportSwitch)
|
||||
if (genderSportSwitch == true)
|
||||
Switch(
|
||||
value: genderSport,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
genderSport = value;
|
||||
_genderSwitcherCheck();
|
||||
if (value == false) {
|
||||
genderSport = false;
|
||||
}
|
||||
else {
|
||||
genderSport = true;
|
||||
}
|
||||
|
||||
print("value: " + value.toString());
|
||||
print("gender: " + genderSport.toString());
|
||||
});
|
||||
},
|
||||
inactiveThumbColor: Colors.lightBlue,
|
||||
@@ -99,13 +90,13 @@ class Sport extends StatelessWidget {
|
||||
ListTile(
|
||||
title: IconButton(
|
||||
icon: Icon(Icons.table_chart),
|
||||
onPressed: () => Navigator.pushNamed(context, '/Standing', arguments: sport_ID),
|
||||
onPressed: () => Navigator.pushNamed(context, '/Standing'),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: IconButton(
|
||||
icon: Icon(Icons.calendar_today),
|
||||
onPressed: () => Navigator.pushNamed(context, '/Schedule',arguments: [sport_ID, _curSport.name],),
|
||||
onPressed: () => Navigator.pushNamed(context, '/Schedule'),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -115,7 +106,8 @@ class Sport extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
DropdownButtonHideUnderline buildDropdownButton(Item selectedSport, StateSetter setState) {
|
||||
DropdownButtonHideUnderline buildDropdownButton(
|
||||
Item selectedSport, StateSetter setState) {
|
||||
return DropdownButtonHideUnderline(
|
||||
child: DropdownButton<Item>(
|
||||
value: selectedSport,
|
||||
@@ -131,7 +123,44 @@ class Sport extends StatelessWidget {
|
||||
onChanged: (Item value) {
|
||||
setState(() {
|
||||
_curSport = value;
|
||||
_genderSwitcherCheck();
|
||||
|
||||
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);
|
||||
});
|
||||
},
|
||||
@@ -147,25 +176,11 @@ 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, this.sportID);
|
||||
const Item(this.name, this.color);
|
||||
|
||||
final String name;
|
||||
final Color color;
|
||||
final List<int> sportID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,25 +3,10 @@ import 'package:flutter/material.dart';
|
||||
import '../twitter_assets/tweet.dart';
|
||||
|
||||
class TwitterFeed extends StatelessWidget{
|
||||
List<Tweet> fuck = [];
|
||||
final test = new Tweet(1, "We'll get through this together, Niner Nation. #WeAreAllNiners", "@unccharlotte", "https://pbs.twimg.com/profile_images/1175214096280629249/QC79Xju2_400x400.jpg", "test");
|
||||
final test2 = new Tweet(2, "Let's test your UNC Charlotte knowledge...do you know why we became the 49ers? Here's the full history on the pioneering spirit that shaped our trajectory http://bit.ly/UNCC-1949", "@unccharlotte", "https://pbs.twimg.com/profile_images/1175214096280629249/QC79Xju2_400x400.jpg", "test");
|
||||
final test3 = new Tweet(3, "Niner Nation means uplifting each other. This 4/9 Day, let's show our students why #WeAreAllNiners by supporting the Student Emergency Relief Fund ️ http://bit.ly/UNCC-SER", "@unccharlotte", "https://pbs.twimg.com/profile_images/1175214096280629249/QC79Xju2_400x400.jpg", "test");
|
||||
final test4 = new Tweet(4, "Niner Nation: Chancellor Dubois shares that UNC Charlotte will be able to apply our established parking refund procedures with special considerations for the impact of COVID-19.", "@unccharlotte", "https://pbs.twimg.com/profile_images/1175214096280629249/QC79Xju2_400x400.jpg", "test");
|
||||
final test5 = new Tweet(5, "4/9 Day is just for us, Niner Nation. From wherever you are, you're family #WeAreAllNiners", "@unccharlotte", "https://pbs.twimg.com/profile_images/1175214096280629249/QC79Xju2_400x400.jpg", "test");
|
||||
final test6= new Tweet(6, "Niner Nation, #49erAlumni Gene Johnson ’73 is getting us excited for 4/9 Day tomorrow! Put on your Niner gear, call your friends and let’s celebrate together virtually \n We’re all in this together! ", "@unccharlotte", "https://pbs.twimg.com/profile_images/1175214096280629249/QC79Xju2_400x400.jpg", "test");
|
||||
final test7 = new Tweet(7, "From virtual events to one-on-one sessions with counselors, it's easy to stay connected with @UNCCAdmissions", "@unccharlotte", "https://pbs.twimg.com/profile_images/1175214096280629249/QC79Xju2_400x400.jpg", "test");
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
fuck.add(test);
|
||||
fuck.add(test2);
|
||||
fuck.add(test3);
|
||||
fuck.add(test4);
|
||||
fuck.add(test5);
|
||||
fuck.add(test6);
|
||||
fuck.add(test7);
|
||||
|
||||
return StatefulBuilder(
|
||||
builder: (context, StateSetter setState) => Scaffold(
|
||||
@@ -33,7 +18,16 @@ class TwitterFeed extends StatelessWidget{
|
||||
body: Container(
|
||||
color: Colors.black12,
|
||||
child:
|
||||
VerticalTwitterFeed(twitterFeed: fuck),
|
||||
FutureBuilder(
|
||||
future: _buildTwitter(),
|
||||
builder: (ctx, snapshot){
|
||||
if(!snapshot.hasData){
|
||||
return Center(child: CircularProgressIndicator());
|
||||
}else{
|
||||
return snapshot.data;
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
drawer: Drawer(
|
||||
child: ListView(
|
||||
@@ -63,3 +57,7 @@ class TwitterFeed extends StatelessWidget{
|
||||
}
|
||||
}
|
||||
|
||||
Future<VerticalTwitterFeed> _buildTwitter() async {
|
||||
final feed = TwitterFeedCreation();
|
||||
return VerticalTwitterFeed(twitterFeed: feed);
|
||||
}
|
||||
|
||||
@@ -3,29 +3,29 @@ import 'package:flutter/material.dart';
|
||||
class Tweet {
|
||||
final int id;
|
||||
final String text;
|
||||
final String userName;
|
||||
final String userImgUrl;
|
||||
final String url;
|
||||
//final String userName;
|
||||
//final String userImgUrl;
|
||||
//final String url;
|
||||
|
||||
Tweet(
|
||||
this.id,
|
||||
this.id, {
|
||||
this.text,
|
||||
this.userName,
|
||||
this.userImgUrl,
|
||||
this.url,
|
||||
// this.userName,
|
||||
// this.userImgUrl,
|
||||
// this.url,
|
||||
}
|
||||
);
|
||||
|
||||
/*factory Tweet.fromJson(Map<String, dynamic> json) {
|
||||
factory Tweet.fromJson(Map<String, dynamic> json) {
|
||||
return Tweet(
|
||||
json['id_str'],
|
||||
text: json['text'],
|
||||
userName: json['user']['name'],
|
||||
userImgUrl: json['user']['profile_image_url_https'],
|
||||
url: json['urls']['expanded_url'],
|
||||
text: json['full_text'],
|
||||
//userName: json['user']['name'],
|
||||
//userImgUrl: json['user']['profile_image_url_https'],
|
||||
//url: json['urls']['expanded_url'],
|
||||
);
|
||||
}
|
||||
Commenting out till we figure out the API
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class TwitterCard extends StatelessWidget{
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 0),
|
||||
child: ListTile(
|
||||
leading: SizedBox(
|
||||
/* leading: SizedBox(
|
||||
height: 150,
|
||||
width: 75,
|
||||
child: Container(
|
||||
@@ -58,9 +58,9 @@ class TwitterCard extends StatelessWidget{
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
title: Text('${tweet.userName}'),
|
||||
subtitle: Text('${tweet.text}'),
|
||||
), */
|
||||
// title: Text('${tweet.userName}'),
|
||||
title: Text('${tweet.text}'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -3,44 +3,85 @@ 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 {
|
||||
static final twitterBase = 'https://api.twitter.com/1.1/search';
|
||||
|
||||
static final apiKey = 'AFBfOqx8uXIUBZMxAFoQyO3zA';
|
||||
static final apiSecret = '48Gp7nczz9SqExorwYuWpA6Nmviuox6Beq83kjH1XtYtunorym';
|
||||
|
||||
getToken() async {
|
||||
http.Response response = await http.get('https://api.twitter.com/oauth2/token',);
|
||||
}
|
||||
Future<List<Tweet>> getPage() async {
|
||||
|
||||
/*Future<List<Tweet>> getPage({int size = 10}) async {
|
||||
var url = '$twitterBase/tweets.json?q=from%3ACharlotteFTBL&result_type=mixed&count=$size';
|
||||
http.Response response = await http.get(url,
|
||||
headers: <String, String> {'authorization': apiKey,}
|
||||
|
||||
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 List<Tweet> twitterFeed;
|
||||
final TwitterFeedCreation twitterFeed;
|
||||
|
||||
const VerticalTwitterFeed({
|
||||
Key key,
|
||||
@required this.twitterFeed,
|
||||
}) : super(key: key);
|
||||
}) : super(key: key);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
/*
|
||||
return Container(
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
@@ -51,9 +92,9 @@ class VerticalTwitterFeed extends StatelessWidget{
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
); */
|
||||
|
||||
/* return Container(
|
||||
return Container(
|
||||
child: FutureBuilder(
|
||||
future: twitterFeed.getPage(),
|
||||
builder: (ctx, snapshot){
|
||||
@@ -73,6 +114,8 @@ class VerticalTwitterFeed extends StatelessWidget{
|
||||
}
|
||||
},
|
||||
),
|
||||
); */
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -58,7 +58,7 @@ packages:
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
@@ -273,6 +273,13 @@ 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:
|
||||
|
||||
@@ -24,6 +24,8 @@ dependencies:
|
||||
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user