Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various changes #46

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ A guide that documents the process of configuring advances parts of the scouting
- `prematch` - Contains fields for initials, match number, and team number, and automatically selects the team based on the match number and driver station configured in the settings.
*All inputs on this page feed into the `lib/utils/data/values/PrematchValues.dart` values.*
- `qrcode` - Contains routes for scanning QR codes and managing related data for creating or saving them.
- `settings` - Provides the settings route where users configure event ID, QR code centerfold, team number editability, and other important settings for app functionality.
- `settings` - Provides the settings route where users configure event ID, team number editability, and other important settings for app functionality.
*All inputs on this page feed into the `lib/utils/data/values/SettingValues.dart` values.*
- `styles` - Contains widgets for easily generating headers and titles, as well as a set of colors used throughout the app to maintain uniformity in the scouting platform.
- `utils` - Includes utilities like constants, value files, and helpers to support app functionality.
Expand Down
Binary file not shown.
Binary file removed assets/images/centerfolds/bruh_centerfold.png
Binary file not shown.
Binary file removed assets/images/centerfolds/cheese.png
Binary file not shown.
Binary file removed assets/images/centerfolds/huh_centerfold.png
Binary file not shown.
Binary file removed assets/images/centerfolds/hungwy_centerfold.png
Binary file not shown.
Binary file removed assets/images/centerfolds/jimmy_centerfold.png
Binary file not shown.
Binary file removed assets/images/centerfolds/jqr_code_centerfold.png
Binary file not shown.
Binary file not shown.
Binary file removed assets/images/centerfolds/peppa_pig_centerfold.png
Binary file not shown.
Binary file not shown.
16 changes: 8 additions & 8 deletions lib/routes/auto/AutonomousDataRoute.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,28 +151,28 @@ class _DataRouteState extends State<AutonomousDataRoute> {
),
],
),
// various right side data entry and labels
const AutonomousRightLabel1(),
const AutonomousRightRow1(),
const AutonomousRightLabel2(),
const AutonomousRightRow2(),
const AutonomousRightLabel3(),
const AutonomousRightRow3(),
// robot information
Align(
alignment: Alignment.centerLeft,
child: Container(
width: 400.0,
padding: const EdgeInsets.only(top: 20.0, right: 0.0),
child: Text(
"Driver Station: ${SettingValues.selectedDriverStation.text}, Match #: ${PrematchValues.matchNumber.text}, Team # ${PrematchValues.teamNumber.text}",
"Driver Station: ${SettingValues.selectedDriverStation.text}, Match #${PrematchValues.matchNumber.text}, Team #${PrematchValues.teamNumber.text}",
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 15.0),
),
)),
// various right side data entry and labels
const AutonomousRightLabel1(),
const AutonomousRightRow1(),
const AutonomousRightLabel2(),
const AutonomousRightRow2(),
const AutonomousRightLabel3(),
const AutonomousRightRow3(),
],
),
),
Expand Down
81 changes: 55 additions & 26 deletions lib/routes/comments/fields/CommentsFields.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,61 @@ class _CommentsFields extends State<CommentsFields> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const TitleStyle(
text: "Auto Comments",
padding: EdgeInsets.only(top: 10.0, left: 18.0)),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const TitleStyle(
text: "Auto Comments",
padding: EdgeInsets.only(top: 10.0, left: 18.0)),
Row(children: [
Align(
alignment: Alignment.bottomRight,
child: Container(
padding: EdgeInsets.only(right: 10),
height: 30.0,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: AppStyle
.textInputColorLight, // Set the background color here
),
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return const TeleopRoute(title: "Teleop/Endgame");
}));
},
child: const Text("< Teleop/Endgame",
style: TextStyle(
fontSize: 12.0,
fontFamily: "Helvetica",
color: Colors.white)),
))),
Align(
alignment: Alignment.bottomRight,
child: Container(
padding: EdgeInsets.only(right: 60),
height: 30.0,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: AppStyle
.textInputColorLight, // Set the background color here
),
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return const QRCodeRoute(title: "QR Code");
}));
},
child: const Text("Current QR Code >",
style: TextStyle(
fontSize: 12.0,
fontFamily: "Helvetica",
color: Colors.white)),
))),
]),
],
),
TextInputField(
onChanged: (value) {
setState(() {
Expand Down Expand Up @@ -99,29 +151,6 @@ class _CommentsFields extends State<CommentsFields> {
fontFamily: "Helvetica",
color: Colors.white)),
))),
Align(
alignment: Alignment.bottomRight,
child: Container(
padding: const EdgeInsets.only(
top: 4.0, right: 40, left: 80.0, bottom: 20.0),
height: 80.0,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: AppStyle
.textInputColorLight, // Set the background color here
),
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return const TeleopRoute(title: "Teleop/Endgame");
}));
},
child: const Text("< Teleop/Endgame",
style: TextStyle(
fontSize: 24.0,
fontFamily: "Helvetica",
color: Colors.white)),
)))
],
);
}
Expand Down
8 changes: 1 addition & 7 deletions lib/routes/qrcode/QRCodeRoute.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// ignore_for_file: prefer_const_constructors, file_names
import 'package:flutter/material.dart';
import 'package:scouting_platform/builders/PlatformRoute.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:scouting_platform/builders/PlatformRoute.dart';
import 'package:scouting_platform/utils/helpers/QRCodeHelper.dart';
import 'package:scouting_platform/utils/helpers/UIHelper.dart';
import 'package:scouting_platform/utils/data/values/SettingValues.dart';

class QRCodeRoute extends StatelessWidget {
const QRCodeRoute({super.key, required this.title});
Expand All @@ -22,11 +21,6 @@ class QRCodeRoute extends StatelessWidget {
child: QrImageView(
data: QrcodeHelper.getQRCodeString(),
backgroundColor: Colors.white,
embeddedImage: SettingValues.currentSelectedCenterfold.text ==
"none"
? null
: AssetImage(
"assets/images/centerfolds/${SettingValues.currentSelectedCenterfold.text}.png"),
errorCorrectionLevel: QrErrorCorrectLevel.L,
version: QrVersions.auto,
))));
Expand Down
19 changes: 0 additions & 19 deletions lib/routes/settings/SettingsRoute.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,25 +135,6 @@ class _SettingsRoute extends State<SettingsRoute> {
),
Row(
children: [
Column(
children: [
const TitleStyle(
text: "QR Code Centerfold",
padding: EdgeInsets.only(left: 30, top: 10)),
PlatformDropdownMenu(
margin: const EdgeInsets.only(top: 10, right: 30),
selectedItemFontSize: 10.0,
dropdownMenuSelectedItem:
SettingValues.currentSelectedCenterfold.text,
onChanged: (value) {
setState(() {
SettingValues.currentSelectedCenterfold.text =
value;
});
},
dropdownItems: OptionConstants.centerfolds),
],
),
Column(
children: [
const TitleStyle(
Expand Down
39 changes: 11 additions & 28 deletions lib/routes/teleop/TeleopRoute.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,12 @@ class _TeleopRouteState extends State<TeleopRoute> {
physics: const AlwaysScrollableScrollPhysics(),
child: Column(children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.only(left: 20, top: 10.0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(150.0, 40.0),
backgroundColor: AppStyle.textInputColor,
),
onPressed: () {
showConformationDialog(context);
},
child: const Text("Reset",
style: TextStyle(
fontSize: 14.0,
fontFamily: "Helvetica",
color: Colors.white)),
),
),
Align(
alignment: Alignment.bottomRight,
child: Container(
padding: const EdgeInsets.only(top: 4.0, right: 60),
padding: const EdgeInsets.only(top: 4.0, right: 10),
// height: 47.0,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
Expand Down Expand Up @@ -109,29 +92,29 @@ class _TeleopRouteState extends State<TeleopRoute> {
))),
],
),
const TeleoperatedLabels4(),
const TeleoperatedFields4(),
const TeleoperatedLabels3(),
const TeleoperatedFields3(),
const TeleoperatedLabels2(),
const TeleoperatedFields2(),
const TeleoperatedLabels(),
const TeleoperatedFields(),
// robot info
Align(
alignment: Alignment.centerLeft,
child: Container(
width: 400.0,
padding: const EdgeInsets.only(top: 20.0, left: 20.0),
child: Text(
"Driver Station: ${SettingValues.selectedDriverStation.text}, Match #: ${PrematchValues.matchNumber.text}, Team #: ${PrematchValues.teamNumber.text}",
"Driver Station: ${SettingValues.selectedDriverStation.text}, Match #${PrematchValues.matchNumber.text}, Team #${PrematchValues.teamNumber.text}",
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 15.0),
),
)),
const TeleoperatedLabels4(),
const TeleoperatedFields4(),
const TeleoperatedLabels3(),
const TeleoperatedFields3(),
const TeleoperatedLabels2(),
const TeleoperatedFields2(),
const TeleoperatedLabels(),
const TeleoperatedFields(),
]),
),
);
Expand Down
14 changes: 0 additions & 14 deletions lib/utils/data/constants/OptionConstants.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
// ignore_for_file: file_names

class OptionConstants {
static List<String> centerfolds = [
"bottle_of_wotah_centerfold",
"bruh_centerfold",
"cheese",
"huh_centerfold",
"hungwy_centerfold",
"jimmy_centerfold",
"jqr_code_centerfold",
"kiss_motore_centerfold",
"peppa_pig_centerfold",
"who_did_this_centerfold",
"none"
];

static final yesNoOptions = ["Yes", "No"];

static final startPositions = ["Left", "Center", "Right"];
Expand Down
2 changes: 0 additions & 2 deletions lib/utils/data/values/AutonomousValues.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class AutonomousValues {
static TextEditingController l2F = TextEditingController(text: "0");
static TextEditingController l2G = TextEditingController(text: "0");


static void resetAutoEtcValues() {
AutonomousValues.autoStartPosition.text = "Center";
AutonomousValues.autoMobility.text = "No";
Expand Down Expand Up @@ -130,5 +129,4 @@ class AutonomousValues {
AutonomousValues.l4K.text = "0";
AutonomousValues.l4L.text = "0";
}

}
4 changes: 0 additions & 4 deletions lib/utils/data/values/CommentValues.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ import 'package:flutter/material.dart';
class CommentValues {
static final TextEditingController autoComments =
TextEditingController(text: "");
static final TextEditingController autoOrder =
TextEditingController(text: "");
static final TextEditingController teleopComments =
TextEditingController(text: "");
static final TextEditingController endgameComments =
TextEditingController(text: "");


static void resetComments() {
CommentValues.autoComments.text = "";
CommentValues.autoOrder.text = "";
CommentValues.teleopComments.text = "";
CommentValues.endgameComments.text = "";
}
Expand Down
2 changes: 0 additions & 2 deletions lib/utils/data/values/EndgameValues.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ class EndgameValues {
static TextEditingController endgame = TextEditingController(text: "No");
static TextEditingController climbTime = TextEditingController(text: "0");


static void resetEndgameValues() {
EndgameValues.endgame.text = "No"; // was climb, now endgame
EndgameValues.climbTime.text = "0"; // parked was below
EndgameValues.stopwatchState.text = "0";
EndgameValues.stopwatch.stop();
EndgameValues.stopwatch.reset();
}

}
2 changes: 0 additions & 2 deletions lib/utils/data/values/SettingValues.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import 'package:flutter/material.dart';
import 'package:scouting_platform/utils/data/constants/AppConstants.dart';

class SettingValues {
static final TextEditingController currentSelectedCenterfold =
TextEditingController(text: "none");
static TextEditingController selectedDriverStation =
TextEditingController(text: "Red 1");

Expand Down
2 changes: 0 additions & 2 deletions lib/utils/data/values/TeleoperatedValues.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class TeleoperatedValues {
TextEditingController(text: "0");
static TextEditingController fieldCrosses = TextEditingController(text: "0");


static void resetTeleopValues() {
TeleoperatedValues.coralNearL1.text = "0";
TeleoperatedValues.coralNearL2.text = "0";
Expand All @@ -36,5 +35,4 @@ class TeleoperatedValues {
TeleoperatedValues.humanPlayerMisses.text = "0";
TeleoperatedValues.fieldCrosses.text = "0";
}

}
14 changes: 14 additions & 0 deletions lib/utils/helpers/AppDataHelper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ class AppDataHelper {
}
}

static Future<void> saveQRCodeCopy(String data) async {
final status = await Permission.storage.request();
if (status.isGranted) {
final file = File(
"/storage/emulated/0/Documents/${AppConstants.defaultEventID}_output.csv");
if (!await file.exists()) {
await file.create();
}
await file.writeAsString("$data\n", mode: FileMode.append);
} else {
throw Exception('Permission denied');
}
}

// Get the current event ID from a file called "current_event_id.txt"
static Future<String> getCurrentEventIDAndCurrentDriverStation() async {
final status = await Permission.storage.request();
Expand Down
Loading
Loading