Skip to content

Commit

Permalink
Merge pull request #32 from FRC2706/dev
Browse files Browse the repository at this point in the history
v1.0.9
  • Loading branch information
jwt2706 authored Mar 5, 2024
2 parents 58711f3 + 71922ee commit 2eea4c9
Show file tree
Hide file tree
Showing 23 changed files with 87 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
interval: "daily"
target-branch: "dev"
- package-ecosystem: "pub"
directory: "/"
schedule:
interval: "weekly"
interval: "daily"
commit-message:
prefix: "Dependencies"
include: "scope"
Expand Down
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 6 additions & 14 deletions assets/games/2024.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@
"name": "Team #",
"required": false,
"type": "number"
},
{
"name": "Auto Start Position",
"type": "clickable_image",
"filename": "images/field_image.png",
"clickRestriction": "one",
"allowableResponses": "1 12 13 24 25 36 37 48 49 60 61 72",
"shape": "circle 5 black red true"
}
],
"Autonomous": [
Expand All @@ -66,15 +58,15 @@
],
"TeleOp": [
{
"name": "Notes Picked Up From Ground",
"name": "TeleOp Notes Picked Up From Ground",
"type": "counter"
},
{
"name": "Notes Picked Up From Source",
"name": "TeleOp Notes Picked Up From Source",
"type": "counter"
},
{
"name": "Notes Dropped",
"name": "TeleOp Notes Dropped",
"type": "counter"
},
{
Expand Down Expand Up @@ -123,21 +115,21 @@
"name": "Note in Trap",
"type": "radio",
"required": true,
"choices": ["Yes", "Attempted, but failed", "Not attempted"]
"choices": ["Not attempted", "Yes", "Attempted, but failed"]
},
{
"name": "Cilmb",
"type": "radio",
"required": true,
"choices": ["Yes, alone", "Yes, with teammate", "Attempted, but failed", "Not attempted"]
"choices": ["Not attempted", "Yes, alone", "Yes, with teammate", "Attempted, but failed"]
}
],
"PostMatch": [
{
"name": "Driver Skill",
"type": "radio",
"required": true,
"choices": ["Not Effective", "Average", "Very Effective", "Not Observed"]
"choices": ["Not Observed", "Not Effective", "Average", "Very Effective"]
},
{
"name": "Defense Rating",
Expand Down
7 changes: 7 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ PODS:
- qr_code_scanner (0.2.0):
- Flutter
- MTBBarcodeScanner
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- url_launcher_ios (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `Flutter`)
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)

SPEC REPOS:
Expand All @@ -21,13 +25,16 @@ EXTERNAL SOURCES:
:path: Flutter
qr_code_scanner:
:path: ".symlinks/plugins/qr_code_scanner/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812

PODFILE CHECKSUM: 70d9d25280d0dd177a5f637cdb0f0b0b12c6a189
Expand Down
4 changes: 3 additions & 1 deletion ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>NSCameraUsageDescription</key>
<string>We use the camera to scan QR codes</string>
<key>CFBundleDisplayName</key>
<string>Merge Data</string>
<string>MergeData</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand Down
12 changes: 10 additions & 2 deletions lib/screens/match_scouting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ class _MatchScoutingState extends State<MatchScoutingPage> {
)),
Container(
padding: const EdgeInsets.all(5),
child: TextField(
child: TextFormField(
decoration: InputDecoration(
border:
const OutlineInputBorder(),
Expand All @@ -363,6 +363,10 @@ class _MatchScoutingState extends State<MatchScoutingPage> {
? 'This field is required'
: null,
),
initialValue: textValues[data
.values
.toList()[index - 1]
[index2]["name"]],
onChanged: (newString) {
if (data.values
.toList()[index - 1]
Expand Down Expand Up @@ -477,7 +481,7 @@ class _MatchScoutingState extends State<MatchScoutingPage> {
)),
Container(
padding: const EdgeInsets.all(5),
child: TextField(
child: TextFormField(
decoration: InputDecoration(
border:
const OutlineInputBorder(),
Expand All @@ -492,6 +496,10 @@ class _MatchScoutingState extends State<MatchScoutingPage> {
FilteringTextInputFormatter
.digitsOnly
],
initialValue: textValues[data
.values
.toList()[index - 1]
[index2]["name"]],
onChanged: (newString) {
if (data.values
.toList()[index - 1]
Expand Down
38 changes: 31 additions & 7 deletions lib/screens/scan.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/services.dart';
import 'package:merge_data/screens/send_data.dart';
import 'package:qr_code_scanner/qr_code_scanner.dart';

class ScanResultsPage extends StatefulWidget {
Expand All @@ -18,13 +21,27 @@ class ScanResultsPage extends StatefulWidget {
class _ScanResultsPageState extends State<ScanResultsPage> {
final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
Barcode? result;
bool sentData = false;
QRViewController? controller;

void sendData(values, isGame) {
// redirect to `send_data.dart` and pass the data
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SendData(
data: values,
isGame: isGame,
)),
);
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title, style: const TextStyle(color: Colors.black)),
),
body: Column(
children: <Widget>[
Expand All @@ -42,9 +59,6 @@ class _ScanResultsPageState extends State<ScanResultsPage> {
onQRViewCreated: _onQRViewCreated,
),
),
if (result != null)
Text(
'Barcode Type: ${describeEnum(result!.format)} Data: ${result!.code}')
],
),
);
Expand All @@ -53,9 +67,19 @@ class _ScanResultsPageState extends State<ScanResultsPage> {
void _onQRViewCreated(QRViewController controller) {
this.controller = controller;
controller.scannedDataStream.listen((scanData) {
setState(() {
result = scanData;
});
result = scanData;
if (result != null && !sentData) {
sentData = true;
String? resultData = result!.code;
try {
Map? resultDataMap = jsonDecode(resultData!);
bool? isGame = resultDataMap!['isGame'] == "y" ? true : false;
resultDataMap.remove("isGame");
sendData(resultDataMap, isGame);
} catch (e) {
print('Error decoding JSON: $e');
}
}
});
}

Expand Down
25 changes: 17 additions & 8 deletions lib/screens/send_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ class SendData extends StatefulWidget {
final bool isGame;
final bool justSend;

SendData({Key? key, required this.data, required this.isGame, this.justSend = false})
SendData(
{Key? key,
required this.data,
required this.isGame,
this.justSend = false})
: super(key: key);

@override
Expand Down Expand Up @@ -62,16 +66,16 @@ class _SendDataState extends State<SendData> {
final savedGames = prefs.getStringList('savedGames') ?? [];

if (savedGames.isEmpty && widget.data.isEmpty) {
message = "Shep couldn\'t find any saved games to send! That means IT'S TIME TO GO SCOUTING SOME MORE!!1!11!";
message =
"Shep couldn\'t find any saved games to send! That means IT'S TIME TO GO SCOUTING SOME MORE!!1!11!";
} else {

if (widget.isGame) {
// Send locally stored games
for (final savedGame in savedGames) {
final gameData = jsonDecode(savedGame);
List<dynamic> values = gameData.values.toList();
await sheet.values.appendRow(values);
}
}
// Clear the saved games after sending them
final a = await prefs.setStringList('savedGames', []);
ScaffoldMessenger.of(context).showSnackBar(
Expand Down Expand Up @@ -174,7 +178,12 @@ class _SendDataState extends State<SendData> {
child: Icon(Icons.qr_code),
onPressed: () {
setState(() {
dataString = jsonEncode(widget.data);
Map tempData = {};
for (MapEntry entry in widget.data.entries) {
tempData[entry.key] = entry.value;
}
tempData['isGame'] = widget.isGame ? "y" : "n";
dataString = jsonEncode(tempData);
showQR = true;
});
},
Expand All @@ -190,8 +199,8 @@ class _SendDataState extends State<SendData> {
return AlertDialog(
title: Text('Save data locally?'),
content: Text(
"The data will NOT be uploaded yet, but will be saved locally.\n"
"You can send it later. JUST DON'T FORGET TO SEND IT!"),
"The data will NOT be uploaded yet, but will be saved locally.\n"
"You can send it later. JUST DON'T FORGET TO SEND IT!"),
actions: [
TextButton(
child: Text('Yes'),
Expand All @@ -217,7 +226,7 @@ class _SendDataState extends State<SendData> {
);
},
),

SizedBox(width: 10),
FloatingActionButton(
child: Icon(Icons.send),
Expand Down
7 changes: 7 additions & 0 deletions macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
PODS:
- FlutterMacOS (1.0.0)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS

DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)

EXTERNAL SOURCES:
FlutterMacOS:
:path: Flutter/ephemeral
shared_preferences_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos

SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95

PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ packages:
dependency: transitive
description:
name: googleapis_auth
sha256: "772779fe28a8b70939eab9c390a5f8f46cbb59bda9f1f10ea60dd894eff59ff0"
sha256: cafc46446574fd42826aa4cd4d623c94482598fda0a5a5649bf2781bcbc09258
url: "https://pub.dev"
source: hosted
version: "1.4.2"
version: "1.5.0"
gsheets:
dependency: "direct main"
description:
Expand Down Expand Up @@ -473,10 +473,10 @@ packages:
dependency: transitive
description:
name: url_launcher_ios
sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03"
sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5"
url: "https://pub.dev"
source: hosted
version: "6.2.4"
version: "6.2.5"
url_launcher_linux:
dependency: transitive
description:
Expand Down
Binary file removed windows/runner/resources/app_icon.ico
Binary file not shown.
Binary file added windows/runner/resources/app_icon.ico.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2eea4c9

Please sign in to comment.