Skip to content

Commit ad2c201

Browse files
authored
Various changes (#46)
* no centerfolds, nav button positions, save qr data to file for backup * move robot scout info to bottom
1 parent 8f361c0 commit ad2c201

25 files changed

+113
-147
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ A guide that documents the process of configuring advances parts of the scouting
5757
- `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.
5858
*All inputs on this page feed into the `lib/utils/data/values/PrematchValues.dart` values.*
5959
- `qrcode` - Contains routes for scanning QR codes and managing related data for creating or saving them.
60-
- `settings` - Provides the settings route where users configure event ID, QR code centerfold, team number editability, and other important settings for app functionality.
60+
- `settings` - Provides the settings route where users configure event ID, team number editability, and other important settings for app functionality.
6161
*All inputs on this page feed into the `lib/utils/data/values/SettingValues.dart` values.*
6262
- `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.
6363
- `utils` - Includes utilities like constants, value files, and helpers to support app functionality.
Binary file not shown.
-100 KB
Binary file not shown.

assets/images/centerfolds/cheese.png

-24.6 KB
Binary file not shown.
-78.6 KB
Binary file not shown.
-789 KB
Binary file not shown.
-506 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

lib/routes/auto/AutonomousDataRoute.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,28 +151,28 @@ class _DataRouteState extends State<AutonomousDataRoute> {
151151
),
152152
],
153153
),
154+
// various right side data entry and labels
155+
const AutonomousRightLabel1(),
156+
const AutonomousRightRow1(),
157+
const AutonomousRightLabel2(),
158+
const AutonomousRightRow2(),
159+
const AutonomousRightLabel3(),
160+
const AutonomousRightRow3(),
154161
// robot information
155162
Align(
156163
alignment: Alignment.centerLeft,
157164
child: Container(
158165
width: 400.0,
159166
padding: const EdgeInsets.only(top: 20.0, right: 0.0),
160167
child: Text(
161-
"Driver Station: ${SettingValues.selectedDriverStation.text}, Match #: ${PrematchValues.matchNumber.text}, Team # ${PrematchValues.teamNumber.text}",
168+
"Driver Station: ${SettingValues.selectedDriverStation.text}, Match #${PrematchValues.matchNumber.text}, Team #${PrematchValues.teamNumber.text}",
162169
textAlign: TextAlign.left,
163170
style: TextStyle(
164171
color: Colors.white,
165172
fontWeight: FontWeight.bold,
166173
fontSize: 15.0),
167174
),
168175
)),
169-
// various right side data entry and labels
170-
const AutonomousRightLabel1(),
171-
const AutonomousRightRow1(),
172-
const AutonomousRightLabel2(),
173-
const AutonomousRightRow2(),
174-
const AutonomousRightLabel3(),
175-
const AutonomousRightRow3(),
176176
],
177177
),
178178
),

lib/routes/comments/fields/CommentsFields.dart

Lines changed: 55 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,61 @@ class _CommentsFields extends State<CommentsFields> {
2222
return Column(
2323
crossAxisAlignment: CrossAxisAlignment.start,
2424
children: [
25-
const TitleStyle(
26-
text: "Auto Comments",
27-
padding: EdgeInsets.only(top: 10.0, left: 18.0)),
25+
Row(
26+
crossAxisAlignment: CrossAxisAlignment.center,
27+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
28+
children: [
29+
const TitleStyle(
30+
text: "Auto Comments",
31+
padding: EdgeInsets.only(top: 10.0, left: 18.0)),
32+
Row(children: [
33+
Align(
34+
alignment: Alignment.bottomRight,
35+
child: Container(
36+
padding: EdgeInsets.only(right: 10),
37+
height: 30.0,
38+
child: ElevatedButton(
39+
style: ElevatedButton.styleFrom(
40+
backgroundColor: AppStyle
41+
.textInputColorLight, // Set the background color here
42+
),
43+
onPressed: () {
44+
Navigator.push(context,
45+
MaterialPageRoute(builder: (context) {
46+
return const TeleopRoute(title: "Teleop/Endgame");
47+
}));
48+
},
49+
child: const Text("< Teleop/Endgame",
50+
style: TextStyle(
51+
fontSize: 12.0,
52+
fontFamily: "Helvetica",
53+
color: Colors.white)),
54+
))),
55+
Align(
56+
alignment: Alignment.bottomRight,
57+
child: Container(
58+
padding: EdgeInsets.only(right: 60),
59+
height: 30.0,
60+
child: ElevatedButton(
61+
style: ElevatedButton.styleFrom(
62+
backgroundColor: AppStyle
63+
.textInputColorLight, // Set the background color here
64+
),
65+
onPressed: () {
66+
Navigator.push(context,
67+
MaterialPageRoute(builder: (context) {
68+
return const QRCodeRoute(title: "QR Code");
69+
}));
70+
},
71+
child: const Text("Current QR Code >",
72+
style: TextStyle(
73+
fontSize: 12.0,
74+
fontFamily: "Helvetica",
75+
color: Colors.white)),
76+
))),
77+
]),
78+
],
79+
),
2880
TextInputField(
2981
onChanged: (value) {
3082
setState(() {
@@ -99,29 +151,6 @@ class _CommentsFields extends State<CommentsFields> {
99151
fontFamily: "Helvetica",
100152
color: Colors.white)),
101153
))),
102-
Align(
103-
alignment: Alignment.bottomRight,
104-
child: Container(
105-
padding: const EdgeInsets.only(
106-
top: 4.0, right: 40, left: 80.0, bottom: 20.0),
107-
height: 80.0,
108-
child: ElevatedButton(
109-
style: ElevatedButton.styleFrom(
110-
backgroundColor: AppStyle
111-
.textInputColorLight, // Set the background color here
112-
),
113-
onPressed: () {
114-
Navigator.push(context,
115-
MaterialPageRoute(builder: (context) {
116-
return const TeleopRoute(title: "Teleop/Endgame");
117-
}));
118-
},
119-
child: const Text("< Teleop/Endgame",
120-
style: TextStyle(
121-
fontSize: 24.0,
122-
fontFamily: "Helvetica",
123-
color: Colors.white)),
124-
)))
125154
],
126155
);
127156
}

lib/routes/qrcode/QRCodeRoute.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// ignore_for_file: prefer_const_constructors, file_names
22
import 'package:flutter/material.dart';
3-
import 'package:scouting_platform/builders/PlatformRoute.dart';
43
import 'package:qr_flutter/qr_flutter.dart';
4+
import 'package:scouting_platform/builders/PlatformRoute.dart';
55
import 'package:scouting_platform/utils/helpers/QRCodeHelper.dart';
66
import 'package:scouting_platform/utils/helpers/UIHelper.dart';
7-
import 'package:scouting_platform/utils/data/values/SettingValues.dart';
87

98
class QRCodeRoute extends StatelessWidget {
109
const QRCodeRoute({super.key, required this.title});
@@ -22,11 +21,6 @@ class QRCodeRoute extends StatelessWidget {
2221
child: QrImageView(
2322
data: QrcodeHelper.getQRCodeString(),
2423
backgroundColor: Colors.white,
25-
embeddedImage: SettingValues.currentSelectedCenterfold.text ==
26-
"none"
27-
? null
28-
: AssetImage(
29-
"assets/images/centerfolds/${SettingValues.currentSelectedCenterfold.text}.png"),
3024
errorCorrectionLevel: QrErrorCorrectLevel.L,
3125
version: QrVersions.auto,
3226
))));

lib/routes/settings/SettingsRoute.dart

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -135,25 +135,6 @@ class _SettingsRoute extends State<SettingsRoute> {
135135
),
136136
Row(
137137
children: [
138-
Column(
139-
children: [
140-
const TitleStyle(
141-
text: "QR Code Centerfold",
142-
padding: EdgeInsets.only(left: 30, top: 10)),
143-
PlatformDropdownMenu(
144-
margin: const EdgeInsets.only(top: 10, right: 30),
145-
selectedItemFontSize: 10.0,
146-
dropdownMenuSelectedItem:
147-
SettingValues.currentSelectedCenterfold.text,
148-
onChanged: (value) {
149-
setState(() {
150-
SettingValues.currentSelectedCenterfold.text =
151-
value;
152-
});
153-
},
154-
dropdownItems: OptionConstants.centerfolds),
155-
],
156-
),
157138
Column(
158139
children: [
159140
const TitleStyle(

lib/routes/teleop/TeleopRoute.dart

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,12 @@ class _TeleopRouteState extends State<TeleopRoute> {
4242
physics: const AlwaysScrollableScrollPhysics(),
4343
child: Column(children: [
4444
Row(
45-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
45+
mainAxisAlignment: MainAxisAlignment.end,
4646
children: [
47-
Padding(
48-
padding: const EdgeInsets.only(left: 20, top: 10.0),
49-
child: ElevatedButton(
50-
style: ElevatedButton.styleFrom(
51-
minimumSize: const Size(150.0, 40.0),
52-
backgroundColor: AppStyle.textInputColor,
53-
),
54-
onPressed: () {
55-
showConformationDialog(context);
56-
},
57-
child: const Text("Reset",
58-
style: TextStyle(
59-
fontSize: 14.0,
60-
fontFamily: "Helvetica",
61-
color: Colors.white)),
62-
),
63-
),
6447
Align(
6548
alignment: Alignment.bottomRight,
6649
child: Container(
67-
padding: const EdgeInsets.only(top: 4.0, right: 60),
50+
padding: const EdgeInsets.only(top: 4.0, right: 10),
6851
// height: 47.0,
6952
child: ElevatedButton(
7053
style: ElevatedButton.styleFrom(
@@ -109,29 +92,29 @@ class _TeleopRouteState extends State<TeleopRoute> {
10992
))),
11093
],
11194
),
95+
const TeleoperatedLabels4(),
96+
const TeleoperatedFields4(),
97+
const TeleoperatedLabels3(),
98+
const TeleoperatedFields3(),
99+
const TeleoperatedLabels2(),
100+
const TeleoperatedFields2(),
101+
const TeleoperatedLabels(),
102+
const TeleoperatedFields(),
112103
// robot info
113104
Align(
114105
alignment: Alignment.centerLeft,
115106
child: Container(
116107
width: 400.0,
117108
padding: const EdgeInsets.only(top: 20.0, left: 20.0),
118109
child: Text(
119-
"Driver Station: ${SettingValues.selectedDriverStation.text}, Match #: ${PrematchValues.matchNumber.text}, Team #: ${PrematchValues.teamNumber.text}",
110+
"Driver Station: ${SettingValues.selectedDriverStation.text}, Match #${PrematchValues.matchNumber.text}, Team #${PrematchValues.teamNumber.text}",
120111
textAlign: TextAlign.left,
121112
style: TextStyle(
122113
color: Colors.white,
123114
fontWeight: FontWeight.bold,
124115
fontSize: 15.0),
125116
),
126117
)),
127-
const TeleoperatedLabels4(),
128-
const TeleoperatedFields4(),
129-
const TeleoperatedLabels3(),
130-
const TeleoperatedFields3(),
131-
const TeleoperatedLabels2(),
132-
const TeleoperatedFields2(),
133-
const TeleoperatedLabels(),
134-
const TeleoperatedFields(),
135118
]),
136119
),
137120
);

lib/utils/data/constants/OptionConstants.dart

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
// ignore_for_file: file_names
22

33
class OptionConstants {
4-
static List<String> centerfolds = [
5-
"bottle_of_wotah_centerfold",
6-
"bruh_centerfold",
7-
"cheese",
8-
"huh_centerfold",
9-
"hungwy_centerfold",
10-
"jimmy_centerfold",
11-
"jqr_code_centerfold",
12-
"kiss_motore_centerfold",
13-
"peppa_pig_centerfold",
14-
"who_did_this_centerfold",
15-
"none"
16-
];
17-
184
static final yesNoOptions = ["Yes", "No"];
195

206
static final startPositions = ["Left", "Center", "Right"];

lib/utils/data/values/AutonomousValues.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ class AutonomousValues {
6767
static TextEditingController l2F = TextEditingController(text: "0");
6868
static TextEditingController l2G = TextEditingController(text: "0");
6969

70-
7170
static void resetAutoEtcValues() {
7271
AutonomousValues.autoStartPosition.text = "Center";
7372
AutonomousValues.autoMobility.text = "No";
@@ -130,5 +129,4 @@ class AutonomousValues {
130129
AutonomousValues.l4K.text = "0";
131130
AutonomousValues.l4L.text = "0";
132131
}
133-
134132
}

lib/utils/data/values/CommentValues.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ import 'package:flutter/material.dart';
44
class CommentValues {
55
static final TextEditingController autoComments =
66
TextEditingController(text: "");
7-
static final TextEditingController autoOrder =
8-
TextEditingController(text: "");
97
static final TextEditingController teleopComments =
108
TextEditingController(text: "");
119
static final TextEditingController endgameComments =
1210
TextEditingController(text: "");
1311

14-
1512
static void resetComments() {
1613
CommentValues.autoComments.text = "";
17-
CommentValues.autoOrder.text = "";
1814
CommentValues.teleopComments.text = "";
1915
CommentValues.endgameComments.text = "";
2016
}

lib/utils/data/values/EndgameValues.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ class EndgameValues {
1111
static TextEditingController endgame = TextEditingController(text: "No");
1212
static TextEditingController climbTime = TextEditingController(text: "0");
1313

14-
1514
static void resetEndgameValues() {
1615
EndgameValues.endgame.text = "No"; // was climb, now endgame
1716
EndgameValues.climbTime.text = "0"; // parked was below
1817
EndgameValues.stopwatchState.text = "0";
1918
EndgameValues.stopwatch.stop();
2019
EndgameValues.stopwatch.reset();
2120
}
22-
2321
}

lib/utils/data/values/SettingValues.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import 'package:flutter/material.dart';
33
import 'package:scouting_platform/utils/data/constants/AppConstants.dart';
44

55
class SettingValues {
6-
static final TextEditingController currentSelectedCenterfold =
7-
TextEditingController(text: "none");
86
static TextEditingController selectedDriverStation =
97
TextEditingController(text: "Red 1");
108

lib/utils/data/values/TeleoperatedValues.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class TeleoperatedValues {
1919
TextEditingController(text: "0");
2020
static TextEditingController fieldCrosses = TextEditingController(text: "0");
2121

22-
2322
static void resetTeleopValues() {
2423
TeleoperatedValues.coralNearL1.text = "0";
2524
TeleoperatedValues.coralNearL2.text = "0";
@@ -36,5 +35,4 @@ class TeleoperatedValues {
3635
TeleoperatedValues.humanPlayerMisses.text = "0";
3736
TeleoperatedValues.fieldCrosses.text = "0";
3837
}
39-
4038
}

lib/utils/helpers/AppDataHelper.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ class AppDataHelper {
2222
}
2323
}
2424

25+
static Future<void> saveQRCodeCopy(String data) async {
26+
final status = await Permission.storage.request();
27+
if (status.isGranted) {
28+
final file = File(
29+
"/storage/emulated/0/Documents/${AppConstants.defaultEventID}_output.csv");
30+
if (!await file.exists()) {
31+
await file.create();
32+
}
33+
await file.writeAsString("$data\n", mode: FileMode.append);
34+
} else {
35+
throw Exception('Permission denied');
36+
}
37+
}
38+
2539
// Get the current event ID from a file called "current_event_id.txt"
2640
static Future<String> getCurrentEventIDAndCurrentDriverStation() async {
2741
final status = await Permission.storage.request();

0 commit comments

Comments
 (0)