Laser Proxy support
This commit is contained in:
parent
f97222dcc9
commit
5858a4a231
5 changed files with 49 additions and 69 deletions
|
|
@ -4,12 +4,9 @@ import 'dart:convert';
|
|||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:to_csv/to_csv.dart' as exportCSV;
|
||||
|
||||
void getData(String apiKey, String eventCode, Function(List<String>, List<String>) callback) async {
|
||||
void getData(String eventCode, Function(List<String>, List<String>) callback) async {
|
||||
final response = await http.get(
|
||||
Uri.parse('https://www.thebluealliance.com/api/v3/event/$eventCode/teams'),
|
||||
headers: {
|
||||
'X-TBA-Auth-Key': apiKey,
|
||||
},
|
||||
Uri.parse('https://laserscouter.halfheart.net/eventsearch/$eventCode'),
|
||||
);
|
||||
if (response.statusCode == 200) {
|
||||
String data = response.body;
|
||||
|
|
@ -28,10 +25,9 @@ void getData(String apiKey, String eventCode, Function(List<String>, List<String
|
|||
}
|
||||
|
||||
class TeamPicker extends StatefulWidget {
|
||||
final String apiKey;
|
||||
final String eventCode;
|
||||
|
||||
TeamPicker({required this.apiKey, required this.eventCode});
|
||||
TeamPicker({required this.eventCode});
|
||||
|
||||
@override
|
||||
_TeamPickerState createState() => _TeamPickerState();
|
||||
|
|
@ -43,7 +39,6 @@ class NotesPage extends StatefulWidget {
|
|||
final String teamName;
|
||||
NotesPage({required this.teamCode, required this.teamName, required this.eventCode});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
|
|
@ -204,7 +199,7 @@ class _TeamPickerState extends State<TeamPicker> {
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
getData(widget.apiKey, widget.eventCode, (names, codes) {
|
||||
getData(widget.eventCode, (names, codes) {
|
||||
setState(() {
|
||||
teamNames = names;
|
||||
teamCodes = codes;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue