diff --git a/assets/images/reefscape/karthik-reef-diagram-bottom-shorter.png b/assets/images/reefscape/karthik-reef-diagram-bottom-shorter.png new file mode 100644 index 0000000..92b140e Binary files /dev/null and b/assets/images/reefscape/karthik-reef-diagram-bottom-shorter.png differ diff --git a/assets/images/reefscape/karthik-reef-diagram-middle-compressed.png b/assets/images/reefscape/karthik-reef-diagram-middle-compressed.png new file mode 100644 index 0000000..d411690 Binary files /dev/null and b/assets/images/reefscape/karthik-reef-diagram-middle-compressed.png differ diff --git a/assets/images/reefscape/karthik-reef-diagram-middle.png b/assets/images/reefscape/karthik-reef-diagram-middle.png new file mode 100644 index 0000000..fcf3cb3 Binary files /dev/null and b/assets/images/reefscape/karthik-reef-diagram-middle.png differ diff --git a/assets/images/reefscape/karthik-reef-diagram-top-shorter.png b/assets/images/reefscape/karthik-reef-diagram-top-shorter.png new file mode 100644 index 0000000..e4354f0 Binary files /dev/null and b/assets/images/reefscape/karthik-reef-diagram-top-shorter.png differ diff --git a/lib/builders/bases/CustomCheckbox.dart b/lib/builders/bases/CustomCheckbox.dart new file mode 100644 index 0000000..016b4b2 --- /dev/null +++ b/lib/builders/bases/CustomCheckbox.dart @@ -0,0 +1,83 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; + +class CustomCheckbox extends StatefulWidget { + final TextEditingController controller; + final String label; + final EdgeInsets margin; + final Color backgroundColor; + final Color checkColor; + final Color labelColor; + + const CustomCheckbox({ + super.key, + required this.controller, + this.label = "", + this.margin = const EdgeInsets.all(2.0), + this.backgroundColor = Colors.grey, + this.checkColor = Colors.white, + this.labelColor = Colors.white, + }); + + @override + State createState() => _CustomCheckboxState(); +} + +class _CustomCheckboxState extends State { + late bool isChecked; + + @override + void initState() { + super.initState(); + isChecked = widget.controller.text == "1"; + widget.controller.addListener(_updateStateFromController); + } + + @override + void dispose() { + widget.controller.removeListener(_updateStateFromController); + super.dispose(); + } + + void _updateStateFromController() { + setState(() { + isChecked = widget.controller.text == "1"; + }); + } + + @override + Widget build(BuildContext context) { + return Container( + height: 30, + width: 50, + padding: const EdgeInsets.all(0), + margin: widget.margin, + color: widget.backgroundColor, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Checkbox( + value: isChecked, + onChanged: (bool? value) { + setState(() { + isChecked = value ?? false; + widget.controller.text = isChecked ? "1" : "0"; + }); + }, + checkColor: widget.checkColor, + activeColor: Colors.blue, + ), + if (widget.label.isNotEmpty) + Text( + widget.label, + style: TextStyle( + color: widget.labelColor, + fontSize: 16.0, + ), + ), + ], + ), + ); + } +} diff --git a/lib/components/navigation/NavigationSidebar.dart b/lib/components/navigation/NavigationSidebar.dart index ebc6fe3..c0e13dd 100644 --- a/lib/components/navigation/NavigationSidebar.dart +++ b/lib/components/navigation/NavigationSidebar.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:scouting_platform/components/navigation/components/SidebarItem.dart'; +import 'package:scouting_platform/routes/auto/AutonomousDataRoute.dart'; import 'package:scouting_platform/routes/comments/CommentsRoute.dart'; -import 'package:scouting_platform/routes/auto/AutoRoute.dart'; import 'package:scouting_platform/routes/qrcode/QRCodeRoute.dart'; import 'package:scouting_platform/routes/settings/SettingsRoute.dart'; import 'package:scouting_platform/routes/prematch/PrematchRoute.dart'; @@ -35,7 +35,7 @@ class NavigationSidebar extends StatelessWidget { const SidebarItem( icon: Icon(Icons.auto_awesome), itemName: "Auto Data", - route: AutoRoute(title: 'Auto Input')), + route: AutonomousDataRoute(title: 'Auto Input')), const SidebarItem( icon: Icon(Icons.gamepad), itemName: "Teleop Data", diff --git a/lib/routes/auto/AutoRoute.dart b/lib/routes/auto/AutoRoute.dart deleted file mode 100644 index 7eb783e..0000000 --- a/lib/routes/auto/AutoRoute.dart +++ /dev/null @@ -1,177 +0,0 @@ -// ignore_for_file: file_names -import 'package:flutter/material.dart'; -import 'package:scouting_platform/builders/PlatformRoute.dart'; -import 'package:scouting_platform/routes/auto/fields/AutonomousFields.dart'; -import 'package:scouting_platform/routes/auto/labels/AutonomousLabels.dart'; -import 'package:scouting_platform/routes/prematch/PrematchRoute.dart'; -import 'package:scouting_platform/routes/teleop/TeleopRoute.dart'; -import 'package:scouting_platform/styles/components/TitleStyle.dart'; -import 'package:scouting_platform/styles/AppStyle.dart'; -import 'package:scouting_platform/utils/helpers/ScheduleHelper.dart'; -import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; -import 'package:scouting_platform/utils/data/values/CommentValues.dart'; -import 'package:scouting_platform/utils/data/values/EndgameValues.dart'; -import 'package:scouting_platform/utils/data/values/PrematchValues.dart'; -import 'package:scouting_platform/utils/data/values/SettingValues.dart'; -import 'package:scouting_platform/utils/data/values/TeleoperatedValues.dart'; -import 'package:scouting_platform/utils/helpers/UIHelper.dart'; - -class AutoRoute extends StatefulWidget { - const AutoRoute({super.key, required this.title}); - final String title; - - @override - State createState() => _AutoRouteState(); -} - -class _AutoRouteState extends State { - @override - void initState() { - super.initState(); - UIHelper.setBrightness(0.3); - } - - @override - Widget build(BuildContext context) { - return PlatformRoute( - title: widget.title, - body: SingleChildScrollView( - physics: const AlwaysScrollableScrollPhysics(), - child: Column(children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const TitleStyle( - text: "Auto Data", - padding: EdgeInsets.only(top: 10.0, left: 20.0)), - Padding( - padding: - const EdgeInsets.only(right: 50.0, top: 10.0, left: 125.0), - child: ElevatedButton( - style: ElevatedButton.styleFrom( - minimumSize: const Size(150.0, 47.0), - backgroundColor: AppStyle.textInputColor, - ), - onPressed: () { - showConformationDialog(context); - }, - child: const Text("Reset", - style: TextStyle( - fontSize: 16.0, - fontFamily: "Helvetica", - color: Colors.white)), - ), - ), - Align( - alignment: Alignment.bottomRight, - child: Container( - padding: const EdgeInsets.only(top: 4.0, right: 60), - // height: 47.0, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - minimumSize: const Size(150.0, 47.0), - backgroundColor: AppStyle - .textInputColor, // 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: 16.0, - fontFamily: "Helvetica", - color: Colors.white)), - ))), - ], - ), - const AutonomousLabels(), - const AutonomousFields(), - ]), - ), - ); - } - - showConformationDialog(BuildContext context) { - // set up the buttons - Widget cancelButton = TextButton( - child: const Text("No"), - onPressed: () { - Navigator.of(context, rootNavigator: true).pop('dialog'); - }, - ); - Widget continueButton = TextButton( - child: const Text("Yes"), - onPressed: () { - // Increment the match number - if (PrematchValues.matchNumber.text != "") { - PrematchValues.matchNumber.text = - (int.parse(PrematchValues.matchNumber.text) + 1).toString(); - } else { - PrematchValues.matchNumber.text = (2).toString(); - } - - if (SettingValues.isTeamNumberReadOnly) { - // Get the team number from the schedule and set the team number field to that - Schedulehelper.getTeamNumberFromSchedule( - int.parse(// Get the team number from the schedule - PrematchValues.matchNumber.text)) - .then((teamNumber) => - PrematchValues.teamNumber.text = teamNumber.toString()); - } - - setState(() { - AutonomousValues.autoSpeakerScored.text = "0"; - AutonomousValues.autoSpeakerMissed.text = "0"; - AutonomousValues.autoAmpMissed.text = "0"; - AutonomousValues.autoAmpScored.text = "0"; - TeleoperatedValues.coralNearL1.text = "0"; - TeleoperatedValues.coralNearL2.text = "0"; - TeleoperatedValues.coralNearL3.text = "0"; - TeleoperatedValues.coralNearL4.text = "0"; - TeleoperatedValues.coralFarL1.text = "0"; - TeleoperatedValues.coralFarL2.text = "0"; - TeleoperatedValues.coralFarL3.text = "0"; - TeleoperatedValues.coralFarL4.text = "0"; - TeleoperatedValues.coralMissed.text = "0"; - TeleoperatedValues.algaeRemoved.text = "0"; - TeleoperatedValues.algaeProcessor.text = "0"; - TeleoperatedValues.algaeBarge.text = "0"; - TeleoperatedValues.humanPlayerMisses.text = "0"; - TeleoperatedValues.fieldCrosses.text = "0"; - AutonomousValues.autoMobility.text = "No"; - 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(); - CommentValues.autoComments.text = ""; - CommentValues.autoOrder.text = ""; - CommentValues.teleopComments.text = ""; - CommentValues.endgameComments.text = ""; - }); - Navigator.of(context, rootNavigator: true).pop('dialog'); - Navigator.push(context, MaterialPageRoute(builder: (context) { - return const PrematchRoute(title: "Prematch Data"); - })); - }, - ); // set up the AlertDialog - AlertDialog alert = AlertDialog( - title: const Text("Confirmation: Reset ALL Fields"), - content: const Text( - "Would you like to reset all of the fields current inputted?"), - actions: [ - cancelButton, - continueButton, - ], - ); // show the dialog - showDialog( - context: context, - builder: (BuildContext context) { - return alert; - }, - ); - } -} diff --git a/lib/routes/auto/AutonomousDataRoute.dart b/lib/routes/auto/AutonomousDataRoute.dart new file mode 100644 index 0000000..3371cab --- /dev/null +++ b/lib/routes/auto/AutonomousDataRoute.dart @@ -0,0 +1,237 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/builders/PlatformRoute.dart'; +import 'package:scouting_platform/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow1.dart'; +import 'package:scouting_platform/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow2.dart'; +import 'package:scouting_platform/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow3.dart'; +import 'package:scouting_platform/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow4.dart'; +import 'package:scouting_platform/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow5.dart'; +import 'package:scouting_platform/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow6.dart'; +import 'package:scouting_platform/routes/auto/fields/AutonomousRightRows/AutonomousRightRow1.dart'; +import 'package:scouting_platform/routes/auto/fields/AutonomousRightRows/AutonomousRightRow2.dart'; +import 'package:scouting_platform/routes/auto/fields/AutonomousRightRows/AutonomousRightRow3.dart'; +import 'package:scouting_platform/routes/auto/fields/AutonomousRows.dart/AutonomousBottomReef.dart'; +import 'package:scouting_platform/routes/auto/fields/AutonomousRows.dart/AutonomousMiddleReef.dart'; +import 'package:scouting_platform/routes/auto/fields/AutonomousRows.dart/AutonomousTopReef.dart'; +import 'package:scouting_platform/routes/auto/labels/AutonomousRightLabels/AutonomousRightLabel1.dart'; +import 'package:scouting_platform/routes/auto/labels/AutonomousRightLabels/AutonomousRightLabel2.dart'; +import 'package:scouting_platform/routes/auto/labels/AutonomousRightLabels/AutonomousRightLabel3.dart'; +import 'package:scouting_platform/routes/prematch/PrematchRoute.dart'; +import 'package:scouting_platform/routes/teleop/TeleopRoute.dart'; +import 'package:scouting_platform/styles/AppStyle.dart'; +import 'package:scouting_platform/utils/data/values/PrematchValues.dart'; +import 'package:scouting_platform/utils/data/values/SettingValues.dart'; +import 'package:scouting_platform/utils/helpers/AppDataHelper.dart'; +import 'package:scouting_platform/utils/helpers/ScheduleHelper.dart'; +import 'package:scouting_platform/utils/helpers/UIHelper.dart'; + +class AutonomousDataRoute extends StatefulWidget { + const AutonomousDataRoute({super.key, required this.title}); + final String title; + + @override + State createState() => _DataRouteState(); +} + +class _DataRouteState extends State { + @override + void initState() { + super.initState(); + UIHelper.setBrightness(0.3); + } + + @override + Widget build(BuildContext context) { + return PlatformRoute( + title: widget.title, + body: SingleChildScrollView( + physics: const AlwaysScrollableScrollPhysics(), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Left Column + Expanded( + flex: 1, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // all components of reef diagram + // top check boxes + const AutonomousRow1(), + const AutonomousRow2(), + const AutonomousRow3(), + + // thirds of the reef diagram with counters for trough + const AutonomousTopReef(), + const AutonomousMiddleReef(), + const AutonomousBottomReef(), + + // bottom check boxes + const AutonomousRow4(), + const AutonomousRow5(), + const AutonomousRow6(), + ], + ), + ), + // Right Column + Expanded( + flex: 1, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + // reset button + ElevatedButton( + style: ElevatedButton.styleFrom( + minimumSize: const Size(150.0, 37.0), + backgroundColor: AppStyle.textInputColor, + ), + onPressed: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) { + return const PrematchRoute(title: "Prematch"); + })); + }, + child: const Text( + "< Prematch", + style: TextStyle( + fontSize: 16.0, + fontFamily: "Helvetica", + color: Colors.white, + ), + )), + SizedBox(width: 8.0), + + // reset button + ElevatedButton( + style: ElevatedButton.styleFrom( + minimumSize: const Size(150.0, 37.0), + backgroundColor: AppStyle.textInputColor, + ), + onPressed: () { + showConformationDialog(context); + }, + child: const Text( + "Reset", + style: TextStyle( + fontSize: 16.0, + fontFamily: "Helvetica", + color: Colors.white, + ), + ), + ), + + const SizedBox(width: 8.0), + + // next page button + ElevatedButton( + style: ElevatedButton.styleFrom( + minimumSize: const Size(150.0, 37.0), + backgroundColor: AppStyle.textInputColor, + ), + onPressed: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) { + return const TeleopRoute(title: "Comments"); + })); + }, + child: const Text( + "Teleop >", + style: TextStyle( + fontSize: 16.0, + fontFamily: "Helvetica", + color: Colors.white, + ), + ), + ), + ], + ), + // 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}", + 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(), + ], + ), + ), + ], + ), + ), + ), + ); + } + + void showConformationDialog(BuildContext context) { + Widget cancelButton = TextButton( + child: const Text("No"), + onPressed: () { + Navigator.of(context, rootNavigator: true).pop('dialog'); + }, + ); + Widget continueButton = TextButton( + child: const Text("Yes"), + onPressed: () { + if (PrematchValues.matchNumber.text != "") { + PrematchValues.matchNumber.text = + (int.parse(PrematchValues.matchNumber.text) + 1).toString(); + } else { + PrematchValues.matchNumber.text = (2).toString(); + } + + if (SettingValues.isTeamNumberReadOnly) { + Schedulehelper.getTeamNumberFromSchedule( + int.parse(PrematchValues.matchNumber.text), + ).then((teamNumber) => + PrematchValues.teamNumber.text = teamNumber.toString()); + } + + setState(() { + AppDataHelper.resetStates(); + }); + Navigator.of(context, rootNavigator: true).pop('dialog'); + Navigator.push(context, MaterialPageRoute(builder: (context) { + return const PrematchRoute(title: "Prematch Data"); + })); + }, + ); + + AlertDialog alert = AlertDialog( + title: const Text("Confirmation: Reset ALL Fields"), + content: const Text( + "Would you like to reset all of the fields currently inputted?"), + actions: [ + cancelButton, + continueButton, + ], + ); + + showDialog( + context: context, + builder: (BuildContext context) { + return alert; + }, + ); + } +} diff --git a/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow1.dart b/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow1.dart new file mode 100644 index 0000000..20eb355 --- /dev/null +++ b/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow1.dart @@ -0,0 +1,92 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; +import 'package:scouting_platform/builders/bases/CustomCheckbox.dart'; + +class AutonomousRow1 extends StatefulWidget { + const AutonomousRow1({ + super.key, + }); + + @override + State createState() => _AutonomousRow1State(); +} + +class _AutonomousRow1State extends State { + /// Increments an integer in a controller's value by one + void incrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue++; + controller.text = currentValue.toString(); + }); + } + + /// Decrements an integer in a controller's value by one unless it's 0 + void decrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue--; + controller.text = (currentValue > 0 ? currentValue : 0).toString(); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration(), + height: 40, // Set a height for the container + child: Row( + mainAxisAlignment: MainAxisAlignment.start, // Center the row contents + children: [ + // A + CustomCheckbox( + controller: AutonomousValues.l4A, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 18.0)), + // L + CustomCheckbox( + controller: AutonomousValues.l4L, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 35.0)), + // K + CustomCheckbox( + controller: AutonomousValues.l4K, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 35.0)), + // J + CustomCheckbox( + controller: AutonomousValues.l4J, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 30.0)), + // I + CustomCheckbox( + controller: AutonomousValues.l4I, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 25.0)), + // H + CustomCheckbox( + controller: AutonomousValues.l4H, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.all(00.0)), + ], + ), + ); + } +} diff --git a/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow2.dart b/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow2.dart new file mode 100644 index 0000000..9273b26 --- /dev/null +++ b/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow2.dart @@ -0,0 +1,92 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; +import 'package:scouting_platform/builders/bases/CustomCheckbox.dart'; + +class AutonomousRow2 extends StatefulWidget { + const AutonomousRow2({ + super.key, + }); + + @override + State createState() => _AutonomousRow2State(); +} + +class _AutonomousRow2State extends State { + /// Increments an integer in a controller's value by one + void incrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue++; + controller.text = currentValue.toString(); + }); + } + + /// Decrements an integer in a controller's value by one unless it's 0 + void decrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue--; + controller.text = (currentValue > 0 ? currentValue : 0).toString(); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration(), + height: 40, // Set a height for the container + child: Row( + mainAxisAlignment: MainAxisAlignment.start, // Center the row contents + children: [ + // A + CustomCheckbox( + controller: AutonomousValues.l3A, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 18.0)), + // L + CustomCheckbox( + controller: AutonomousValues.l3L, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 35.0)), + // K + CustomCheckbox( + controller: AutonomousValues.l3K, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 35.0)), + // J + CustomCheckbox( + controller: AutonomousValues.l3J, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 30.0)), + // I + CustomCheckbox( + controller: AutonomousValues.l3I, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 25.0)), + // H + CustomCheckbox( + controller: AutonomousValues.l3H, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.all(0.0)), + ], + ), + ); + } +} diff --git a/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow3.dart b/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow3.dart new file mode 100644 index 0000000..76cbd21 --- /dev/null +++ b/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow3.dart @@ -0,0 +1,92 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; +import 'package:scouting_platform/builders/bases/CustomCheckbox.dart'; + +class AutonomousRow3 extends StatefulWidget { + const AutonomousRow3({ + super.key, + }); + + @override + State createState() => _AutonomousRow3State(); +} + +class _AutonomousRow3State extends State { + /// Increments an integer in a controller's value by one + void incrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue++; + controller.text = currentValue.toString(); + }); + } + + /// Decrements an integer in a controller's value by one unless it's 0 + void decrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue--; + controller.text = (currentValue > 0 ? currentValue : 0).toString(); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration(), + height: 40, // Set a height for the container + child: Row( + mainAxisAlignment: MainAxisAlignment.start, // Center the row contents + children: [ + // A + CustomCheckbox( + controller: AutonomousValues.l2A, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 18.0)), + // L + CustomCheckbox( + controller: AutonomousValues.l2L, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 35.0)), + // K + CustomCheckbox( + controller: AutonomousValues.l2K, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 35.0)), + // J + CustomCheckbox( + controller: AutonomousValues.l2J, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 30.0)), + // I + CustomCheckbox( + controller: AutonomousValues.l2I, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 25.0)), + // H + CustomCheckbox( + controller: AutonomousValues.l2H, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 0.0)), + ], + ), + ); + } +} diff --git a/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow4.dart b/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow4.dart new file mode 100644 index 0000000..8135e84 --- /dev/null +++ b/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow4.dart @@ -0,0 +1,92 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; +import 'package:scouting_platform/builders/bases/CustomCheckbox.dart'; + +class AutonomousRow4 extends StatefulWidget { + const AutonomousRow4({ + super.key, + }); + + @override + State createState() => _AutonomousRow4State(); +} + +class _AutonomousRow4State extends State { + /// Increments an integer in a controller's value by one + void incrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue++; + controller.text = currentValue.toString(); + }); + } + + /// Decrements an integer in a controller's value by one unless it's 0 + void decrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue--; + controller.text = (currentValue > 0 ? currentValue : 0).toString(); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration(), + height: 40, // Set a height for the container + child: Row( + mainAxisAlignment: MainAxisAlignment.start, // Center the row contents + children: [ + // B + CustomCheckbox( + controller: AutonomousValues.l4B, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 18.0)), + // C + CustomCheckbox( + controller: AutonomousValues.l4C, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 35.0)), + // D + CustomCheckbox( + controller: AutonomousValues.l4D, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 35.0)), + // E + CustomCheckbox( + controller: AutonomousValues.l4E, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 30.0)), + // F + CustomCheckbox( + controller: AutonomousValues.l4F, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 25.0)), + // G + CustomCheckbox( + controller: AutonomousValues.l4G, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 0.0)), + ], + ), + ); + } +} diff --git a/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow5.dart b/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow5.dart new file mode 100644 index 0000000..0f30462 --- /dev/null +++ b/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow5.dart @@ -0,0 +1,92 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; +import 'package:scouting_platform/builders/bases/CustomCheckbox.dart'; + +class AutonomousRow5 extends StatefulWidget { + const AutonomousRow5({ + super.key, + }); + + @override + State createState() => _AutonomousRow5State(); +} + +class _AutonomousRow5State extends State { + /// Increments an integer in a controller's value by one + void incrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue++; + controller.text = currentValue.toString(); + }); + } + + /// Decrements an integer in a controller's value by one unless it's 0 + void decrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue--; + controller.text = (currentValue > 0 ? currentValue : 0).toString(); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration(), + height: 40, // Set a height for the container + child: Row( + mainAxisAlignment: MainAxisAlignment.start, // Center the row contents + children: [ + // B + CustomCheckbox( + controller: AutonomousValues.l3B, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 18.0)), + // C + CustomCheckbox( + controller: AutonomousValues.l3C, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 35.0)), + // D + CustomCheckbox( + controller: AutonomousValues.l3D, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 35.0)), + // E + CustomCheckbox( + controller: AutonomousValues.l3E, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 30)), + // F + CustomCheckbox( + controller: AutonomousValues.l3F, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 25.0)), + // G + CustomCheckbox( + controller: AutonomousValues.l3G, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 0.0)), + ], + ), + ); + } +} diff --git a/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow6.dart b/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow6.dart new file mode 100644 index 0000000..e50a65b --- /dev/null +++ b/lib/routes/auto/fields/AutonomousCheckboxRows/AutonomousRow6.dart @@ -0,0 +1,92 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; +import 'package:scouting_platform/builders/bases/CustomCheckbox.dart'; + +class AutonomousRow6 extends StatefulWidget { + const AutonomousRow6({ + super.key, + }); + + @override + State createState() => _AutonomousRow6State(); +} + +class _AutonomousRow6State extends State { + /// Increments an integer in a controller's value by one + void incrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue++; + controller.text = currentValue.toString(); + }); + } + + /// Decrements an integer in a controller's value by one unless it's 0 + void decrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue--; + controller.text = (currentValue > 0 ? currentValue : 0).toString(); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration(), + height: 40, // Set a height for the container + child: Row( + mainAxisAlignment: MainAxisAlignment.start, // Center the row contents + children: [ + // B + CustomCheckbox( + controller: AutonomousValues.l2B, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 18.0)), + // C + CustomCheckbox( + controller: AutonomousValues.l2C, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 35.0)), + // D + CustomCheckbox( + controller: AutonomousValues.l2D, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 35.0)), + // E + CustomCheckbox( + controller: AutonomousValues.l2E, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 30.0)), + // F + CustomCheckbox( + controller: AutonomousValues.l2F, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 25.0)), + // G + CustomCheckbox( + controller: AutonomousValues.l2G, + backgroundColor: Colors.grey.shade800, + checkColor: Colors.white, + labelColor: Colors.white, + margin: const EdgeInsets.only(right: 0.0)), + ], + ), + ); + } +} diff --git a/lib/routes/auto/fields/AutonomousRightRows/AutonomousRightRow1.dart b/lib/routes/auto/fields/AutonomousRightRows/AutonomousRightRow1.dart new file mode 100644 index 0000000..c674265 --- /dev/null +++ b/lib/routes/auto/fields/AutonomousRightRows/AutonomousRightRow1.dart @@ -0,0 +1,70 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/builders/bases/PlatformDropdownMenu.dart'; +import 'package:scouting_platform/utils/data/constants/OptionConstants.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; + +class AutonomousRightRow1 extends StatefulWidget { + const AutonomousRightRow1({ + super.key, + }); + + @override + State createState() => _AutonomousRightRow1State(); +} + +class _AutonomousRightRow1State extends State { + /// Increments an integer in a controller's value by one + void incrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue++; + controller.text = currentValue.toString(); + }); + } + + /// Decrements an integer in a controller's value by one unless it's 0 + void decrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue--; + controller.text = (currentValue > 0 ? currentValue : 0).toString(); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration(), + height: 60, // Set a height for the container + child: Row( + mainAxisAlignment: MainAxisAlignment.start, // Center the row contents + children: [ + // Auto starting position + PlatformDropdownMenu( + dropdownMenuSelectedItem: AutonomousValues.autoStartPosition.text, + onChanged: (value) { + setState(() { + AutonomousValues.autoStartPosition.text = value; + }); + }, + dropdownItems: OptionConstants.startPositions), + // Auto mobility + PlatformDropdownMenu( + dropdownMenuSelectedItem: AutonomousValues.autoMobility.text, + onChanged: (value) { + setState(() { + AutonomousValues.autoMobility.text = value; + }); + }, + dropdownItems: OptionConstants.yesNoOptions, + margin: const EdgeInsets.only(left: 10)), + ], + ), + ); + } +} diff --git a/lib/routes/auto/fields/AutonomousRightRows/AutonomousRightRow2.dart b/lib/routes/auto/fields/AutonomousRightRows/AutonomousRightRow2.dart new file mode 100644 index 0000000..8d93138 --- /dev/null +++ b/lib/routes/auto/fields/AutonomousRightRows/AutonomousRightRow2.dart @@ -0,0 +1,72 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/builders/bases/CounterNumberField.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; + +class AutonomousRightRow2 extends StatefulWidget { + const AutonomousRightRow2({ + super.key, + }); + + @override + State createState() => _AutonomousRightRow2State(); +} + +class _AutonomousRightRow2State extends State { + /// Increments an integer in a controller's value by one + void incrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue++; + controller.text = currentValue.toString(); + }); + } + + /// Decrements an integer in a controller's value by one unless it's 0 + void decrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue--; + controller.text = (currentValue > 0 ? currentValue : 0).toString(); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration(), + height: 60, // Set a height for the container + child: Row( + mainAxisAlignment: MainAxisAlignment.start, // Center the row contents + children: [ + // Coral missed counter + CounterNumberField( + margin: EdgeInsets.zero, + controller: AutonomousValues.coralMissed, + onTapIncrement: () => + incrementNumber(AutonomousValues.coralMissed), + onTapDecrement: () => + decrementNumber(AutonomousValues.coralMissed)), + // Coral form field counter + CounterNumberField( + margin: EdgeInsets.only(left: 10), + controller: AutonomousValues.coralField, + onTapIncrement: () => + incrementNumber(AutonomousValues.coralField), + onTapDecrement: () => + decrementNumber(AutonomousValues.coralField)), + // Coral from human player / coral station counter + CounterNumberField( + margin: EdgeInsets.only(left: 10), + controller: AutonomousValues.coralHP, + onTapIncrement: () => incrementNumber(AutonomousValues.coralHP), + onTapDecrement: () => decrementNumber(AutonomousValues.coralHP)), + ], + ), + ); + } +} diff --git a/lib/routes/auto/fields/AutonomousRightRows/AutonomousRightRow3.dart b/lib/routes/auto/fields/AutonomousRightRows/AutonomousRightRow3.dart new file mode 100644 index 0000000..2b0a199 --- /dev/null +++ b/lib/routes/auto/fields/AutonomousRightRows/AutonomousRightRow3.dart @@ -0,0 +1,74 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/builders/bases/CounterNumberField.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; + +class AutonomousRightRow3 extends StatefulWidget { + const AutonomousRightRow3({ + super.key, + }); + + @override + State createState() => _AutonomousRightRow3State(); +} + +class _AutonomousRightRow3State extends State { + /// Increments an integer in a controller's value by one + void incrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue++; + controller.text = currentValue.toString(); + }); + } + + /// Decrements an integer in a controller's value by one unless it's 0 + void decrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue--; + controller.text = (currentValue > 0 ? currentValue : 0).toString(); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration(), + height: 60, // Set a height for the container + child: Row( + mainAxisAlignment: MainAxisAlignment.start, // Center the row contents + children: [ + // Algae removed from reef counter + CounterNumberField( + margin: EdgeInsets.zero, + controller: AutonomousValues.algaeRemoved, + onTapIncrement: () => + incrementNumber(AutonomousValues.algaeRemoved), + onTapDecrement: () => + decrementNumber(AutonomousValues.algaeRemoved)), + // Algae scored in processor counter + CounterNumberField( + margin: EdgeInsets.only(left: 10), + controller: AutonomousValues.algaeProcessor, + onTapIncrement: () => + incrementNumber(AutonomousValues.algaeProcessor), + onTapDecrement: () => + decrementNumber(AutonomousValues.algaeProcessor)), + // Algae scored in barge counter + CounterNumberField( + margin: EdgeInsets.only(left: 10), + controller: AutonomousValues.algaeBarge, + onTapIncrement: () => + incrementNumber(AutonomousValues.algaeBarge), + onTapDecrement: () => + decrementNumber(AutonomousValues.algaeBarge)), + ], + ), + ); + } +} diff --git a/lib/routes/auto/fields/AutonomousRows.dart/AutonomousBottomReef.dart b/lib/routes/auto/fields/AutonomousRows.dart/AutonomousBottomReef.dart new file mode 100644 index 0000000..9710ec2 --- /dev/null +++ b/lib/routes/auto/fields/AutonomousRows.dart/AutonomousBottomReef.dart @@ -0,0 +1,69 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/builders/bases/CounterNumberField.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; + +class AutonomousBottomReef extends StatefulWidget { + const AutonomousBottomReef({ + super.key, + }); + + @override + State createState() => _AutonomousRow1State(); +} + +class _AutonomousRow1State extends State { + // Increments an integer in a controller's value by one + void incrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue++; + controller.text = currentValue.toString(); + }); + } + + /// Decrements an integer in a controller's value by one unless it's 0 + void decrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue--; + controller.text = (currentValue > 0 ? currentValue : 0).toString(); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + 'assets/images/reefscape/karthik-reef-diagram-bottom-shorter.png'), // Replace with your image path + fit: BoxFit.cover, + ), + ), + height: 95, + width: 440, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, // Center the row contents + children: [ + // bottom left side trough counter + CounterNumberField( + margin: EdgeInsets.only(right: 55.0, bottom: 0.0, left: 10.0), + controller: AutonomousValues.l1SW, + onTapDecrement: () => decrementNumber(AutonomousValues.l1SW), + onTapIncrement: () => incrementNumber(AutonomousValues.l1SW)), + // bottom right side trough counter + CounterNumberField( + margin: EdgeInsets.only(right: 0.0, bottom: 0.0), + controller: AutonomousValues.l1SE, + onTapDecrement: () => decrementNumber(AutonomousValues.l1SE), + onTapIncrement: () => incrementNumber(AutonomousValues.l1SE)), + ], + ), + ); + } +} diff --git a/lib/routes/auto/fields/AutonomousRows.dart/AutonomousMiddleReef.dart b/lib/routes/auto/fields/AutonomousRows.dart/AutonomousMiddleReef.dart new file mode 100644 index 0000000..51d2ded --- /dev/null +++ b/lib/routes/auto/fields/AutonomousRows.dart/AutonomousMiddleReef.dart @@ -0,0 +1,69 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/builders/bases/CounterNumberField.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; + +class AutonomousMiddleReef extends StatefulWidget { + const AutonomousMiddleReef({ + super.key, + }); + + @override + State createState() => _AutonomousRow1State(); +} + +class _AutonomousRow1State extends State { + /// Increments an integer in a controller's value by one + void incrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue++; + controller.text = currentValue.toString(); + }); + } + + /// Decrements an integer in a controller's value by one unless it's 0 + void decrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue--; + controller.text = (currentValue > 0 ? currentValue : 0).toString(); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + 'assets/images/reefscape/karthik-reef-diagram-middle-compressed.png'), // Replace with your image path + fit: BoxFit.cover, + ), + ), + height: 50, + width: 440, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, // Center the row contents + children: [ + // left side trough counter + CounterNumberField( + margin: EdgeInsets.only(right: 100.0, bottom: 0.0), + controller: AutonomousValues.l1W, + onTapDecrement: () => decrementNumber(AutonomousValues.l1W), + onTapIncrement: () => incrementNumber(AutonomousValues.l1W)), + // right side trough counter + CounterNumberField( + margin: EdgeInsets.only(right: 0.0, top: 0.0), + controller: AutonomousValues.l1E, + onTapDecrement: () => decrementNumber(AutonomousValues.l1E), + onTapIncrement: () => incrementNumber(AutonomousValues.l1E)), + ], + ), + ); + } +} diff --git a/lib/routes/auto/fields/AutonomousRows.dart/AutonomousTopReef.dart b/lib/routes/auto/fields/AutonomousRows.dart/AutonomousTopReef.dart new file mode 100644 index 0000000..db9d79e --- /dev/null +++ b/lib/routes/auto/fields/AutonomousRows.dart/AutonomousTopReef.dart @@ -0,0 +1,69 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; +import 'package:scouting_platform/builders/bases/CounterNumberField.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; + +class AutonomousTopReef extends StatefulWidget { + const AutonomousTopReef({ + super.key, + }); + + @override + State createState() => _AutonomousRow1State(); +} + +class _AutonomousRow1State extends State { + /// Increments an integer in a controller's value by one + void incrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue++; + controller.text = currentValue.toString(); + }); + } + + /// Decrements an integer in a controller's value by one unless it's 0 + void decrementNumber(TextEditingController controller) { + if (!mounted) return; + + int currentValue = int.parse(controller.text); + setState(() { + currentValue--; + controller.text = (currentValue > 0 ? currentValue : 0).toString(); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + 'assets/images/reefscape/karthik-reef-diagram-top-shorter.png'), // Replace with your image path + fit: BoxFit.cover, + ), + ), + height: 95, + width: 440, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, // Center the row contents + children: [ + // North West (Top Left) trough counter + CounterNumberField( + margin: EdgeInsets.only(right: 50.0, bottom: 20.0, left: 45.0), + controller: AutonomousValues.l1NW, + onTapDecrement: () => decrementNumber(AutonomousValues.l1NW), + onTapIncrement: () => incrementNumber(AutonomousValues.l1NW)), + // North East (Top Right) trough counter + CounterNumberField( + margin: EdgeInsets.only(right: 40.0, bottom: 20.0), + controller: AutonomousValues.l1NE, + onTapDecrement: () => decrementNumber(AutonomousValues.l1NE), + onTapIncrement: () => incrementNumber(AutonomousValues.l1NE)), + ], + ), + ); + } +} diff --git a/lib/routes/teleop/labels/EndgameLabels.dart b/lib/routes/auto/labels/AutonomousRightLabels/AutonomousRightLabel1.dart similarity index 64% rename from lib/routes/teleop/labels/EndgameLabels.dart rename to lib/routes/auto/labels/AutonomousRightLabels/AutonomousRightLabel1.dart index b9cd074..5ff12e3 100644 --- a/lib/routes/teleop/labels/EndgameLabels.dart +++ b/lib/routes/auto/labels/AutonomousRightLabels/AutonomousRightLabel1.dart @@ -1,28 +1,28 @@ // ignore_for_file: file_names import 'package:flutter/material.dart'; -class EndgameLabels extends StatefulWidget { - const EndgameLabels({ +class AutonomousRightLabel1 extends StatefulWidget { + const AutonomousRightLabel1({ super.key, }); @override - State createState() => _EndgameLabelsState(); + State createState() => _AutonomousRightLabel1State(); } -class _EndgameLabelsState extends State { +class _AutonomousRightLabel1State extends State { @override Widget build(BuildContext context) { return Row( children: [ - //climbing + // start pos Align( alignment: Alignment.centerLeft, child: Container( - width: 170.0, - padding: const EdgeInsets.only(left: 20.0, top: 20.0), + width: 150.0, + padding: const EdgeInsets.only(top: 20.0, right: 30.0), child: const Text( - "Endgame", + "Start Position", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -30,15 +30,15 @@ class _EndgameLabelsState extends State { fontSize: 15.0), ), )), - //climb time + // auto mobility Align( alignment: Alignment.centerLeft, child: Container( width: 170.0, - margin: const EdgeInsets.only(left: 55.0), - padding: const EdgeInsets.only(left: 20.0, top: 20.0), + padding: + const EdgeInsets.only(left: 65.0, top: 20.0, right: 30.0), child: const Text( - "Climb Time", + "Mobility", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, diff --git a/lib/routes/auto/labels/AutonomousRightLabels/AutonomousRightLabel2.dart b/lib/routes/auto/labels/AutonomousRightLabels/AutonomousRightLabel2.dart new file mode 100644 index 0000000..ea15c90 --- /dev/null +++ b/lib/routes/auto/labels/AutonomousRightLabels/AutonomousRightLabel2.dart @@ -0,0 +1,67 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; + +class AutonomousRightLabel2 extends StatefulWidget { + const AutonomousRightLabel2({ + super.key, + }); + + @override + State createState() => _AutonomousRightLabel2State(); +} + +class _AutonomousRightLabel2State extends State { + @override + Widget build(BuildContext context) { + return Row( + children: [ + // coral miss auto + Align( + alignment: Alignment.centerLeft, + child: Container( + width: 160.0, + padding: const EdgeInsets.only(top: 20.0, right: 0.0), + child: const Text( + "Coral Missed", + textAlign: TextAlign.left, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15.0), + ), + )), + // coral from field + Align( + alignment: Alignment.centerLeft, + child: Container( + width: 160.0, + padding: const EdgeInsets.only(left: 0.0, top: 20.0, right: 0.0), + child: const Text( + "Coral Field", + textAlign: TextAlign.left, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15.0), + ), + )), + // coral from hp + Align( + alignment: Alignment.centerLeft, + child: Container( + width: 130.0, + padding: const EdgeInsets.only(left: 0.0, top: 20.0, right: 0.0), + child: const Text( + "Coral Loading", + textAlign: TextAlign.left, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15.0), + ), + )), + const Divider(), + ], + ); + } +} diff --git a/lib/routes/auto/labels/AutonomousRightLabels/AutonomousRightLabel3.dart b/lib/routes/auto/labels/AutonomousRightLabels/AutonomousRightLabel3.dart new file mode 100644 index 0000000..d1eda48 --- /dev/null +++ b/lib/routes/auto/labels/AutonomousRightLabels/AutonomousRightLabel3.dart @@ -0,0 +1,67 @@ +// ignore_for_file: file_names +import 'package:flutter/material.dart'; + +class AutonomousRightLabel3 extends StatefulWidget { + const AutonomousRightLabel3({ + super.key, + }); + + @override + State createState() => _AutonomousRightLabel3State(); +} + +class _AutonomousRightLabel3State extends State { + @override + Widget build(BuildContext context) { + return Row( + children: [ + // Alage removed + Align( + alignment: Alignment.centerLeft, + child: Container( + width: 160.0, + padding: const EdgeInsets.only(top: 20.0, right: 0.0), + child: const Text( + "Algae Removed", + textAlign: TextAlign.left, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15.0), + ), + )), + // processor + Align( + alignment: Alignment.centerLeft, + child: Container( + width: 160.0, + padding: const EdgeInsets.only(left: 0.0, top: 20.0, right: 0.0), + child: const Text( + "Algae Processor", + textAlign: TextAlign.left, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15.0), + ), + )), + // barge algae + Align( + alignment: Alignment.centerLeft, + child: Container( + width: 130.0, + padding: const EdgeInsets.only(left: 0.0, top: 20.0, right: 0.0), + child: const Text( + "Algae Barge", + textAlign: TextAlign.left, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15.0), + ), + )), + const Divider(), + ], + ); + } +} diff --git a/lib/routes/comments/fields/CommentsFields.dart b/lib/routes/comments/fields/CommentsFields.dart index 284c482..8ce8fa3 100644 --- a/lib/routes/comments/fields/CommentsFields.dart +++ b/lib/routes/comments/fields/CommentsFields.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:scouting_platform/builders/bases/TextInputField.dart'; import 'package:scouting_platform/routes/qrcode/QRCodeRoute.dart'; +import 'package:scouting_platform/routes/teleop/TeleopRoute.dart'; import 'package:scouting_platform/styles/AppStyle.dart'; import 'package:scouting_platform/styles/components/TitleStyle.dart'; import 'package:scouting_platform/utils/data/values/CommentValues.dart'; @@ -97,6 +98,29 @@ class _CommentsFields extends State { fontSize: 24.0, 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)), ))) ], ); diff --git a/lib/routes/prematch/fields/PrematchFields.dart b/lib/routes/prematch/fields/PrematchFields.dart index 893fc53..72c3280 100644 --- a/lib/routes/prematch/fields/PrematchFields.dart +++ b/lib/routes/prematch/fields/PrematchFields.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:scouting_platform/builders/bases/NumberInputField.dart'; import 'package:scouting_platform/builders/bases/TextInputField.dart'; -import 'package:scouting_platform/routes/auto/AutoRoute.dart'; +import 'package:scouting_platform/routes/auto/AutonomousDataRoute.dart'; import 'package:scouting_platform/styles/AppStyle.dart'; import 'package:scouting_platform/utils/helpers/AppDataHelper.dart'; import 'package:scouting_platform/utils/helpers/ScheduleHelper.dart'; @@ -154,10 +154,10 @@ class _PrematchFieldsState extends State { onPressed: () { Navigator.push(context, MaterialPageRoute(builder: (context) { - return const AutoRoute(title: "Auto Input"); + return const AutonomousDataRoute(title: "Auto"); })); }, - child: const Text("Auto/Teleop >", + child: const Text("Auto >", style: TextStyle( fontSize: 16.0, fontFamily: "Helvetica", diff --git a/lib/routes/teleop/TeleopRoute.dart b/lib/routes/teleop/TeleopRoute.dart index 27edbec..48a0657 100644 --- a/lib/routes/teleop/TeleopRoute.dart +++ b/lib/routes/teleop/TeleopRoute.dart @@ -1,24 +1,22 @@ // ignore_for_file: file_names import 'package:flutter/material.dart'; import 'package:scouting_platform/builders/PlatformRoute.dart'; +import 'package:scouting_platform/routes/auto/AutonomousDataRoute.dart'; import 'package:scouting_platform/routes/comments/CommentsRoute.dart'; +import 'package:scouting_platform/routes/prematch/PrematchRoute.dart'; import 'package:scouting_platform/routes/teleop/fields/TeleoperatedFields.dart'; import 'package:scouting_platform/routes/teleop/fields/TeleoperatedFields2.dart'; import 'package:scouting_platform/routes/teleop/fields/TeleoperatedFields3.dart'; +import 'package:scouting_platform/routes/teleop/fields/TeleoperatedFields4.dart'; import 'package:scouting_platform/routes/teleop/labels/TeleoperatedLabels.dart'; import 'package:scouting_platform/routes/teleop/labels/TeleoperatedLabels2.dart'; import 'package:scouting_platform/routes/teleop/labels/TeleoperatedLabels3.dart'; -import 'package:scouting_platform/routes/teleop/fields/EndgameFields.dart'; -import 'package:scouting_platform/routes/teleop/labels/EndgameLabels.dart'; -import 'package:scouting_platform/routes/prematch/PrematchRoute.dart'; +import 'package:scouting_platform/routes/teleop/labels/TeleoperatedLabels4.dart'; import 'package:scouting_platform/styles/AppStyle.dart'; -import 'package:scouting_platform/utils/helpers/ScheduleHelper.dart'; -import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; -import 'package:scouting_platform/utils/data/values/CommentValues.dart'; -import 'package:scouting_platform/utils/data/values/EndgameValues.dart'; import 'package:scouting_platform/utils/data/values/PrematchValues.dart'; import 'package:scouting_platform/utils/data/values/SettingValues.dart'; -import 'package:scouting_platform/utils/data/values/TeleoperatedValues.dart'; +import 'package:scouting_platform/utils/helpers/AppDataHelper.dart'; +import 'package:scouting_platform/utils/helpers/ScheduleHelper.dart'; import 'package:scouting_platform/utils/helpers/UIHelper.dart'; class TeleopRoute extends StatefulWidget { @@ -47,11 +45,10 @@ class _TeleopRouteState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Padding( - padding: - const EdgeInsets.only(right: 50.0, top: 10.0, left: 125.0), + padding: const EdgeInsets.only(left: 20, top: 10.0), child: ElevatedButton( style: ElevatedButton.styleFrom( - minimumSize: const Size(150.0, 47.0), + minimumSize: const Size(150.0, 40.0), backgroundColor: AppStyle.textInputColor, ), onPressed: () { @@ -59,7 +56,7 @@ class _TeleopRouteState extends State { }, child: const Text("Reset", style: TextStyle( - fontSize: 16.0, + fontSize: 14.0, fontFamily: "Helvetica", color: Colors.white)), ), @@ -71,7 +68,30 @@ class _TeleopRouteState extends State { // height: 47.0, child: ElevatedButton( style: ElevatedButton.styleFrom( - minimumSize: const Size(150.0, 47.0), + minimumSize: const Size(150.0, 40.0), + backgroundColor: AppStyle + .textInputColor, // Set the background color here + ), + onPressed: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) { + return const AutonomousDataRoute(title: "Auto"); + })); + }, + child: const Text("< Auto", + 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), + // height: 47.0, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + minimumSize: const Size(150.0, 40.0), backgroundColor: AppStyle .textInputColor, // Set the background color here ), @@ -83,20 +103,35 @@ class _TeleopRouteState extends State { }, child: const Text("Comments >", style: TextStyle( - fontSize: 16.0, + fontSize: 14.0, fontFamily: "Helvetica", color: Colors.white)), ))), ], ), - const TeleoperatedLabels(), - const TeleoperatedFields(), - const TeleoperatedLabels2(), - const TeleoperatedFields2(), + // 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}", + textAlign: TextAlign.left, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15.0), + ), + )), + const TeleoperatedLabels4(), + const TeleoperatedFields4(), const TeleoperatedLabels3(), const TeleoperatedFields3(), - const EndgameLabels(), - const EndgameFields(), + const TeleoperatedLabels2(), + const TeleoperatedFields2(), + const TeleoperatedLabels(), + const TeleoperatedFields(), ]), ), ); @@ -131,34 +166,7 @@ class _TeleopRouteState extends State { } setState(() { - AutonomousValues.autoSpeakerScored.text = "0"; - AutonomousValues.autoSpeakerMissed.text = "0"; - AutonomousValues.autoAmpMissed.text = "0"; - AutonomousValues.autoAmpScored.text = "0"; - TeleoperatedValues.coralNearL1.text = "0"; - TeleoperatedValues.coralNearL2.text = "0"; - TeleoperatedValues.coralNearL3.text = "0"; - TeleoperatedValues.coralNearL4.text = "0"; - TeleoperatedValues.coralFarL1.text = "0"; - TeleoperatedValues.coralFarL2.text = "0"; - TeleoperatedValues.coralFarL3.text = "0"; - TeleoperatedValues.coralFarL4.text = "0"; - TeleoperatedValues.coralMissed.text = "0"; - TeleoperatedValues.algaeRemoved.text = "0"; - TeleoperatedValues.algaeProcessor.text = "0"; - TeleoperatedValues.algaeBarge.text = "0"; - TeleoperatedValues.humanPlayerMisses.text = "0"; - TeleoperatedValues.fieldCrosses.text = "0"; - AutonomousValues.autoMobility.text = "No"; - 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(); - CommentValues.autoComments.text = ""; - CommentValues.autoOrder.text = ""; - CommentValues.teleopComments.text = ""; - CommentValues.endgameComments.text = ""; + AppDataHelper.resetStates(); }); Navigator.of(context, rootNavigator: true).pop('dialog'); Navigator.push(context, MaterialPageRoute(builder: (context) { diff --git a/lib/routes/teleop/fields/EndgameFields.dart b/lib/routes/teleop/fields/EndgameFields.dart deleted file mode 100644 index 1f0dc04..0000000 --- a/lib/routes/teleop/fields/EndgameFields.dart +++ /dev/null @@ -1,63 +0,0 @@ -// ignore_for_file: file_names -import 'package:flutter/material.dart'; -import 'package:scouting_platform/builders/bases/PlatformDropdownMenu.dart'; -import 'package:scouting_platform/builders/bases/StopwatchButton.dart'; -import 'package:scouting_platform/utils/data/constants/OptionConstants.dart'; -import 'package:scouting_platform/utils/data/values/EndgameValues.dart'; - -class EndgameFields extends StatefulWidget { - const EndgameFields({ - super.key, - }); - - @override - State createState() => _EndgameFieldsState(); -} - -class _EndgameFieldsState extends State { - /// Increments an integer in a controllers value by one - void incrementNumber(TextEditingController controller) { - if (!mounted) return; - - int currentValue = int.parse(controller.text); - setState(() { - currentValue++; - controller.text = currentValue.toString(); - }); - } - - /// Decrements an integer in a controllers value by one unless it's 0 - void decrementNumber(TextEditingController controller) { - if (!mounted) return; - - int currentValue = int.parse(controller.text); - setState(() { - currentValue--; - controller.text = (currentValue > 0 ? currentValue : 0).toString(); - }); - } - - @override - Widget build(BuildContext context) { - return Row( - children: [ - //endgame dropdown - PlatformDropdownMenu( - dropdownMenuSelectedItem: EndgameValues.endgame.text, - onChanged: (value) { - setState(() { - EndgameValues.endgame.text = value; - }); - }, - dropdownItems: OptionConstants.endgameOptions, - margin: const EdgeInsets.only(left: 20)), - //climb time - StopwatchButton( - value: EndgameValues.climbTime, - state: EndgameValues.stopwatchState, - timer: EndgameValues.stopwatch, - ), - ], - ); - } -} diff --git a/lib/routes/teleop/fields/TeleoperatedFields.dart b/lib/routes/teleop/fields/TeleoperatedFields.dart index 2a10e65..d50df26 100644 --- a/lib/routes/teleop/fields/TeleoperatedFields.dart +++ b/lib/routes/teleop/fields/TeleoperatedFields.dart @@ -39,34 +39,20 @@ class _TeleoperatedFieldsState extends State { Widget build(BuildContext context) { return Row( children: [ - //coral l1 scored + //coral l1 near scored CounterNumberField( controller: TeleoperatedValues.coralNearL1, onTapDecrement: () => decrementNumber(TeleoperatedValues.coralNearL1), onTapIncrement: () => incrementNumber(TeleoperatedValues.coralNearL1)), - //coral l2 scored + //coral l1 far scored CounterNumberField( - controller: TeleoperatedValues.coralNearL2, + controller: TeleoperatedValues.coralFarL1, onTapDecrement: () => - decrementNumber(TeleoperatedValues.coralNearL2), + decrementNumber(TeleoperatedValues.coralFarL1), onTapIncrement: () => - incrementNumber(TeleoperatedValues.coralNearL2)), - //coral l3 scored - CounterNumberField( - controller: TeleoperatedValues.coralNearL3, - onTapDecrement: () => - decrementNumber(TeleoperatedValues.coralNearL3), - onTapIncrement: () => - incrementNumber(TeleoperatedValues.coralNearL3)), - //coral l4 scored - CounterNumberField( - controller: TeleoperatedValues.coralNearL4, - onTapDecrement: () => - decrementNumber(TeleoperatedValues.coralNearL4), - onTapIncrement: () => - incrementNumber(TeleoperatedValues.coralNearL4)), + incrementNumber(TeleoperatedValues.coralFarL1)), //coral missed CounterNumberField( controller: TeleoperatedValues.coralMissed, diff --git a/lib/routes/teleop/fields/TeleoperatedFields2.dart b/lib/routes/teleop/fields/TeleoperatedFields2.dart index de8725b..5423c63 100644 --- a/lib/routes/teleop/fields/TeleoperatedFields2.dart +++ b/lib/routes/teleop/fields/TeleoperatedFields2.dart @@ -39,13 +39,13 @@ class _TeleoperatedFields2State extends State { Widget build(BuildContext context) { return Row( children: [ - // coral far l1 + // coral near l2 CounterNumberField( - controller: TeleoperatedValues.coralFarL1, + controller: TeleoperatedValues.coralNearL2, onTapDecrement: () => - decrementNumber(TeleoperatedValues.coralFarL1), + decrementNumber(TeleoperatedValues.coralNearL2), onTapIncrement: () => - incrementNumber(TeleoperatedValues.coralFarL1)), + incrementNumber(TeleoperatedValues.coralNearL2)), // coral far l2 CounterNumberField( controller: TeleoperatedValues.coralFarL2, @@ -53,27 +53,13 @@ class _TeleoperatedFields2State extends State { decrementNumber(TeleoperatedValues.coralFarL2), onTapIncrement: () => incrementNumber(TeleoperatedValues.coralFarL2)), - // coral far l3 + //algae removed CounterNumberField( - controller: TeleoperatedValues.coralFarL3, + controller: TeleoperatedValues.algaeRemoved, onTapDecrement: () => - decrementNumber(TeleoperatedValues.coralFarL3), + decrementNumber(TeleoperatedValues.algaeRemoved), onTapIncrement: () => - incrementNumber(TeleoperatedValues.coralFarL3)), - // coral far l4 - CounterNumberField( - controller: TeleoperatedValues.coralFarL4, - onTapDecrement: () => - decrementNumber(TeleoperatedValues.coralFarL4), - onTapIncrement: () => - incrementNumber(TeleoperatedValues.coralFarL4)), - //algae barge - CounterNumberField( - controller: TeleoperatedValues.algaeBarge, - onTapDecrement: () => - decrementNumber(TeleoperatedValues.algaeBarge), - onTapIncrement: () => - incrementNumber(TeleoperatedValues.algaeBarge)), + incrementNumber(TeleoperatedValues.algaeRemoved)), ], ); } diff --git a/lib/routes/teleop/fields/TeleoperatedFields3.dart b/lib/routes/teleop/fields/TeleoperatedFields3.dart index a8dfaad..0c0492f 100644 --- a/lib/routes/teleop/fields/TeleoperatedFields3.dart +++ b/lib/routes/teleop/fields/TeleoperatedFields3.dart @@ -1,6 +1,8 @@ // ignore_for_file: file_names import 'package:flutter/material.dart'; import 'package:scouting_platform/builders/bases/CounterNumberField.dart'; +import 'package:scouting_platform/builders/bases/StopwatchButton.dart'; +import 'package:scouting_platform/utils/data/values/EndgameValues.dart'; import 'package:scouting_platform/utils/data/values/TeleoperatedValues.dart'; class TeleoperatedFields3 extends StatefulWidget { @@ -39,14 +41,21 @@ class _TeleoperatedFields3State extends State { Widget build(BuildContext context) { return Row( children: [ - //algae removed + // coral near l3 CounterNumberField( - controller: TeleoperatedValues.algaeRemoved, + controller: TeleoperatedValues.coralNearL3, onTapDecrement: () => - decrementNumber(TeleoperatedValues.algaeRemoved), + decrementNumber(TeleoperatedValues.coralNearL3), onTapIncrement: () => - incrementNumber(TeleoperatedValues.algaeRemoved)), - //algae processor + incrementNumber(TeleoperatedValues.coralNearL3)), + // coral far l3 + CounterNumberField( + controller: TeleoperatedValues.coralFarL3, + onTapDecrement: () => + decrementNumber(TeleoperatedValues.coralFarL3), + onTapIncrement: () => + incrementNumber(TeleoperatedValues.coralFarL3)), + // algae processor CounterNumberField( controller: TeleoperatedValues.algaeProcessor, onTapDecrement: () => @@ -60,13 +69,12 @@ class _TeleoperatedFields3State extends State { decrementNumber(TeleoperatedValues.humanPlayerMisses), onTapIncrement: () => incrementNumber(TeleoperatedValues.humanPlayerMisses)), - // field crosses - CounterNumberField( - controller: TeleoperatedValues.fieldCrosses, - onTapDecrement: () => - decrementNumber(TeleoperatedValues.fieldCrosses), - onTapIncrement: () => - incrementNumber(TeleoperatedValues.fieldCrosses)), + //climb time + StopwatchButton( + value: EndgameValues.climbTime, + state: EndgameValues.stopwatchState, + timer: EndgameValues.stopwatch, + ), ], ); } diff --git a/lib/routes/auto/fields/AutonomousFields.dart b/lib/routes/teleop/fields/TeleoperatedFields4.dart similarity index 53% rename from lib/routes/auto/fields/AutonomousFields.dart rename to lib/routes/teleop/fields/TeleoperatedFields4.dart index abbd84f..6feea9a 100644 --- a/lib/routes/auto/fields/AutonomousFields.dart +++ b/lib/routes/teleop/fields/TeleoperatedFields4.dart @@ -3,18 +3,19 @@ import 'package:flutter/material.dart'; import 'package:scouting_platform/builders/bases/CounterNumberField.dart'; import 'package:scouting_platform/builders/bases/PlatformDropdownMenu.dart'; import 'package:scouting_platform/utils/data/constants/OptionConstants.dart'; -import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; +import 'package:scouting_platform/utils/data/values/EndgameValues.dart'; +import 'package:scouting_platform/utils/data/values/TeleoperatedValues.dart'; -class AutonomousFields extends StatefulWidget { - const AutonomousFields({ +class TeleoperatedFields4 extends StatefulWidget { + const TeleoperatedFields4({ super.key, }); @override - State createState() => _AutonomousFieldsState(); + State createState() => _TeleoperatedFields4State(); } -class _AutonomousFieldsState extends State { +class _TeleoperatedFields4State extends State { /// Increments an integer in a controllers value by one void incrementNumber(TextEditingController controller) { if (!mounted) return; @@ -41,44 +42,44 @@ class _AutonomousFieldsState extends State { Widget build(BuildContext context) { return Row( children: [ - // Auto mobility dropdown - PlatformDropdownMenu( - dropdownMenuSelectedItem: AutonomousValues.autoMobility.text, - onChanged: (value) { - setState(() { - AutonomousValues.autoMobility.text = value; - }); - }, - dropdownItems: OptionConstants.yesNoOptions, - margin: const EdgeInsets.only(left: 20)), - //speaker scored + //coral l4 near CounterNumberField( - controller: AutonomousValues.autoSpeakerScored, + controller: TeleoperatedValues.coralNearL4, onTapDecrement: () => - decrementNumber(AutonomousValues.autoSpeakerScored), + decrementNumber(TeleoperatedValues.coralNearL4), onTapIncrement: () => - incrementNumber(AutonomousValues.autoSpeakerScored)), - //speaker missed + incrementNumber(TeleoperatedValues.coralNearL4)), + // coral far l4 CounterNumberField( - controller: AutonomousValues.autoSpeakerMissed, + controller: TeleoperatedValues.coralFarL4, onTapDecrement: () => - decrementNumber(AutonomousValues.autoSpeakerMissed), + decrementNumber(TeleoperatedValues.coralFarL4), onTapIncrement: () => - incrementNumber(AutonomousValues.autoSpeakerMissed)), - //amp scored + incrementNumber(TeleoperatedValues.coralFarL4)), + //algae barge CounterNumberField( - controller: AutonomousValues.autoAmpScored, + controller: TeleoperatedValues.algaeBarge, onTapDecrement: () => - decrementNumber(AutonomousValues.autoAmpScored), + decrementNumber(TeleoperatedValues.algaeBarge), onTapIncrement: () => - incrementNumber(AutonomousValues.autoAmpScored)), - //amp missed + incrementNumber(TeleoperatedValues.algaeBarge)), + //field crosses CounterNumberField( - controller: AutonomousValues.autoAmpMissed, + controller: TeleoperatedValues.fieldCrosses, onTapDecrement: () => - decrementNumber(AutonomousValues.autoAmpMissed), + decrementNumber(TeleoperatedValues.fieldCrosses), onTapIncrement: () => - incrementNumber(AutonomousValues.autoAmpMissed)), + incrementNumber(TeleoperatedValues.fieldCrosses)), + //endgame dropdown + PlatformDropdownMenu( + dropdownMenuSelectedItem: EndgameValues.endgame.text, + onChanged: (value) { + setState(() { + EndgameValues.endgame.text = value; + }); + }, + dropdownItems: OptionConstants.endgameOptions, + margin: const EdgeInsets.only(left: 20)), ], ); } diff --git a/lib/routes/teleop/labels/TeleoperatedLabels.dart b/lib/routes/teleop/labels/TeleoperatedLabels.dart index be03f22..a9406b2 100644 --- a/lib/routes/teleop/labels/TeleoperatedLabels.dart +++ b/lib/routes/teleop/labels/TeleoperatedLabels.dart @@ -15,7 +15,7 @@ class _TeleoperatedLabelsState extends State { Widget build(BuildContext context) { return Row( children: [ - //coral l1 + //coral l1 near Align( alignment: Alignment.centerLeft, child: Container( @@ -25,7 +25,7 @@ class _TeleoperatedLabelsState extends State { top: 20.0, ), child: const Text( - "Coral L1 Near Scored", + "L1 Coral Near", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -33,45 +33,14 @@ class _TeleoperatedLabelsState extends State { fontSize: 15.0), ), )), - //coral l2 + //coral l1 far Align( alignment: Alignment.centerLeft, child: Container( width: 170.0, padding: const EdgeInsets.only(left: 20.0, top: 20.0), child: const Text( - "Coral L2 Near Scored", - textAlign: TextAlign.left, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 15.0), - ), - )), - //coral l3 - Align( - alignment: Alignment.centerLeft, - child: Container( - width: 170.0, - padding: const EdgeInsets.only(left: 20.0, top: 20.0), - child: const Text( - "Coral L3 Near Scored", - textAlign: TextAlign.left, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 15.0), - ), - )), - // coral l4 - Align( - alignment: Alignment.centerLeft, - child: Container( - width: 170.0, - padding: - const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), - child: const Text( - "Coral L4 Near Scored", + "L1 Coral Far", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, diff --git a/lib/routes/teleop/labels/TeleoperatedLabels2.dart b/lib/routes/teleop/labels/TeleoperatedLabels2.dart index 6d84e05..0990d28 100644 --- a/lib/routes/teleop/labels/TeleoperatedLabels2.dart +++ b/lib/routes/teleop/labels/TeleoperatedLabels2.dart @@ -15,7 +15,7 @@ class _TeleoperatedLabels2State extends State { Widget build(BuildContext context) { return Row( children: [ - // coral l1 far scored + // coral l2 near scored Align( alignment: Alignment.centerLeft, child: Container( @@ -23,7 +23,7 @@ class _TeleoperatedLabels2State extends State { padding: const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), child: const Text( - "Coral L1 Far Scored", + "L2 Coral Near", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -39,7 +39,7 @@ class _TeleoperatedLabels2State extends State { padding: const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), child: const Text( - "Coral L2 Far Scored", + "L2 Coral Far", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -47,7 +47,7 @@ class _TeleoperatedLabels2State extends State { fontSize: 15.0), ), )), - // coral l3 far scored + // algae removed Align( alignment: Alignment.centerLeft, child: Container( @@ -55,39 +55,7 @@ class _TeleoperatedLabels2State extends State { padding: const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), child: const Text( - "Coral L3 Far Scored", - textAlign: TextAlign.left, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 15.0), - ), - )), - // coral l4 far scored - Align( - alignment: Alignment.centerLeft, - child: Container( - width: 170.0, - padding: - const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), - child: const Text( - "Coral L4 Far Scored", - textAlign: TextAlign.left, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 15.0), - ), - )), - // algae barge - Align( - alignment: Alignment.centerLeft, - child: Container( - width: 170.0, - padding: - const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), - child: const Text( - "Algae Barge", + "Algae Removed", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, diff --git a/lib/routes/teleop/labels/TeleoperatedLabels3.dart b/lib/routes/teleop/labels/TeleoperatedLabels3.dart index c204f0b..e3b4a66 100644 --- a/lib/routes/teleop/labels/TeleoperatedLabels3.dart +++ b/lib/routes/teleop/labels/TeleoperatedLabels3.dart @@ -15,7 +15,7 @@ class _TeleoperatedLabels3State extends State { Widget build(BuildContext context) { return Row( children: [ - // algae removed + // l3 coral near Align( alignment: Alignment.centerLeft, child: Container( @@ -23,7 +23,7 @@ class _TeleoperatedLabels3State extends State { padding: const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), child: const Text( - "Algae Removed", + "L3 Coral Near", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -31,7 +31,23 @@ class _TeleoperatedLabels3State extends State { fontSize: 15.0), ), )), - // algae processor + // l3 coral far + Align( + alignment: Alignment.centerLeft, + child: Container( + width: 170.0, + padding: + const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), + child: const Text( + "L3 Coral Far", + textAlign: TextAlign.left, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15.0), + ), + )), + // processor Align( alignment: Alignment.centerLeft, child: Container( @@ -55,7 +71,7 @@ class _TeleoperatedLabels3State extends State { padding: const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), child: const Text( - "Human Player Misses", + "HP Misses", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -63,7 +79,7 @@ class _TeleoperatedLabels3State extends State { fontSize: 15.0), ), )), - // field crosses + // climb time Align( alignment: Alignment.centerLeft, child: Container( @@ -71,7 +87,7 @@ class _TeleoperatedLabels3State extends State { padding: const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), child: const Text( - "Field Crosses", + "Climb Time", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, diff --git a/lib/routes/auto/labels/AutonomousLabels.dart b/lib/routes/teleop/labels/TeleoperatedLabels4.dart similarity index 72% rename from lib/routes/auto/labels/AutonomousLabels.dart rename to lib/routes/teleop/labels/TeleoperatedLabels4.dart index 632bc59..87adefd 100644 --- a/lib/routes/auto/labels/AutonomousLabels.dart +++ b/lib/routes/teleop/labels/TeleoperatedLabels4.dart @@ -1,29 +1,28 @@ // ignore_for_file: file_names import 'package:flutter/material.dart'; -class AutonomousLabels extends StatefulWidget { - const AutonomousLabels({ +class TeleoperatedLabels4 extends StatefulWidget { + const TeleoperatedLabels4({ super.key, }); @override - State createState() => _AutonomousLabelsState(); + State createState() => _TeleoperatedLabels4State(); } -class _AutonomousLabelsState extends State { +class _TeleoperatedLabels4State extends State { @override Widget build(BuildContext context) { return Row( children: [ - // Auto mobility status + //coral l4 near Align( alignment: Alignment.centerLeft, child: Container( width: 170.0, - padding: - const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), + padding: const EdgeInsets.only(left: 20.0, top: 20.0), child: const Text( - "Mobility", + "L4 Coral Near", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -31,15 +30,15 @@ class _AutonomousLabelsState extends State { fontSize: 15.0), ), )), - //Auto Speaker Scored + // coral l4 far Align( alignment: Alignment.centerLeft, child: Container( width: 170.0, - margin: const EdgeInsets.only(left: 50.0), - padding: const EdgeInsets.only(left: 25.0, top: 20.0), + padding: + const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), child: const Text( - "Speaker Scored", + "L4 Coral Far", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -47,14 +46,15 @@ class _AutonomousLabelsState extends State { fontSize: 15.0), ), )), - //auto speaker missed + // algae barge Align( alignment: Alignment.centerLeft, child: Container( width: 170.0, - padding: const EdgeInsets.only(left: 25.0, top: 20.0), + padding: + const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), child: const Text( - "Speaker Missed", + "Algae Barge", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -62,14 +62,15 @@ class _AutonomousLabelsState extends State { fontSize: 15.0), ), )), - //auto amp scored + // field crosses Align( alignment: Alignment.centerLeft, child: Container( width: 170.0, - padding: const EdgeInsets.only(left: 25.0, top: 20.0), + padding: + const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), child: const Text( - "Amp Scored", + "Field Crosses", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -77,14 +78,15 @@ class _AutonomousLabelsState extends State { fontSize: 15.0), ), )), - //Auto Amp Missed + // endgame Align( alignment: Alignment.centerLeft, child: Container( width: 170.0, - padding: const EdgeInsets.only(left: 25.0, top: 20.0), + padding: + const EdgeInsets.only(left: 20.0, top: 20.0, right: 30.0), child: const Text( - "Amp Missed", + "Endgame", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -92,7 +94,6 @@ class _AutonomousLabelsState extends State { fontSize: 15.0), ), )), - const Divider(), ], ); diff --git a/lib/utils/data/constants/AppConstants.dart b/lib/utils/data/constants/AppConstants.dart index 7bcf0da..26d39a3 100644 --- a/lib/utils/data/constants/AppConstants.dart +++ b/lib/utils/data/constants/AppConstants.dart @@ -1,12 +1,12 @@ // ignore_for_file: file_names class AppConstants { - static const int year = 2024; + static const int year = 2025; static const String appName = "Scouting Platform"; static const bool isDebug = false; - static const String defaultEventID = "2024onha2"; + static const String defaultEventID = "2023oncmp2"; static const String defaultFileName = "2024-STEMley"; static const String githubSchedulesCDN = diff --git a/lib/utils/data/constants/OptionConstants.dart b/lib/utils/data/constants/OptionConstants.dart index 11ed574..1411c8e 100644 --- a/lib/utils/data/constants/OptionConstants.dart +++ b/lib/utils/data/constants/OptionConstants.dart @@ -17,6 +17,8 @@ class OptionConstants { static final yesNoOptions = ["Yes", "No"]; + static final startPositions = ["Left", "Center", "Right"]; + static final endgameOptions = ["No", "Shallow", "Deep", "Park"]; static List availableDriverstations = [ diff --git a/lib/utils/data/values/AutonomousValues.dart b/lib/utils/data/values/AutonomousValues.dart index 1e50f9f..8219ff4 100644 --- a/lib/utils/data/values/AutonomousValues.dart +++ b/lib/utils/data/values/AutonomousValues.dart @@ -2,11 +2,133 @@ import 'package:flutter/material.dart'; class AutonomousValues { + // other + static TextEditingController autoStartPosition = + TextEditingController(text: "Center"); static TextEditingController autoMobility = TextEditingController(text: "No"); - static TextEditingController autoSpeakerScored = + static TextEditingController coralHP = TextEditingController(text: "0"); + static TextEditingController coralField = TextEditingController(text: "0"); + static TextEditingController coralMissed = TextEditingController(text: "0"); + static TextEditingController algaeRemoved = TextEditingController(text: "0"); + static TextEditingController algaeProcessor = TextEditingController(text: "0"); - static TextEditingController autoSpeakerMissed = - TextEditingController(text: "0"); - static TextEditingController autoAmpScored = TextEditingController(text: "0"); - static TextEditingController autoAmpMissed = TextEditingController(text: "0"); + static TextEditingController algaeBarge = TextEditingController(text: "0"); + + // L1 trough sides + static TextEditingController l1NW = TextEditingController(text: "0"); + static TextEditingController l1NE = TextEditingController(text: "0"); + static TextEditingController l1W = TextEditingController(text: "0"); + static TextEditingController l1E = TextEditingController(text: "0"); + static TextEditingController l1SW = TextEditingController(text: "0"); + static TextEditingController l1SE = TextEditingController(text: "0"); + + // L4 trough sides + static TextEditingController l4A = TextEditingController(text: "0"); + static TextEditingController l4L = TextEditingController(text: "0"); + static TextEditingController l4K = TextEditingController(text: "0"); + static TextEditingController l4J = TextEditingController(text: "0"); + static TextEditingController l4I = TextEditingController(text: "0"); + static TextEditingController l4H = TextEditingController(text: "0"); + + static TextEditingController l4B = TextEditingController(text: "0"); + static TextEditingController l4C = TextEditingController(text: "0"); + static TextEditingController l4D = TextEditingController(text: "0"); + static TextEditingController l4E = TextEditingController(text: "0"); + static TextEditingController l4F = TextEditingController(text: "0"); + static TextEditingController l4G = TextEditingController(text: "0"); + + // L3 trough sides + static TextEditingController l3A = TextEditingController(text: "0"); + static TextEditingController l3L = TextEditingController(text: "0"); + static TextEditingController l3K = TextEditingController(text: "0"); + static TextEditingController l3J = TextEditingController(text: "0"); + static TextEditingController l3I = TextEditingController(text: "0"); + static TextEditingController l3H = TextEditingController(text: "0"); + + static TextEditingController l3B = TextEditingController(text: "0"); + static TextEditingController l3C = TextEditingController(text: "0"); + static TextEditingController l3D = TextEditingController(text: "0"); + static TextEditingController l3E = TextEditingController(text: "0"); + static TextEditingController l3F = TextEditingController(text: "0"); + static TextEditingController l3G = TextEditingController(text: "0"); + + // L2 through sides + static TextEditingController l2A = TextEditingController(text: "0"); + static TextEditingController l2L = TextEditingController(text: "0"); + static TextEditingController l2K = TextEditingController(text: "0"); + static TextEditingController l2J = TextEditingController(text: "0"); + static TextEditingController l2I = TextEditingController(text: "0"); + static TextEditingController l2H = TextEditingController(text: "0"); + + static TextEditingController l2B = TextEditingController(text: "0"); + static TextEditingController l2C = TextEditingController(text: "0"); + static TextEditingController l2D = TextEditingController(text: "0"); + static TextEditingController l2E = TextEditingController(text: "0"); + static TextEditingController l2F = TextEditingController(text: "0"); + static TextEditingController l2G = TextEditingController(text: "0"); + + + static void resetAutoEtcValues() { + AutonomousValues.autoStartPosition.text = "Center"; + AutonomousValues.autoMobility.text = "No"; + AutonomousValues.coralMissed.text = "0"; + AutonomousValues.coralHP.text = "0"; + AutonomousValues.coralField.text = "0"; + AutonomousValues.algaeRemoved.text = "0"; + AutonomousValues.algaeBarge.text = "0"; + AutonomousValues.algaeProcessor.text = "0"; + } + + static void resetAutoReef() { + // tough coral + AutonomousValues.l1E.text = "0"; + AutonomousValues.l1NE.text = "0"; + AutonomousValues.l1NW.text = "0"; + AutonomousValues.l1SE.text = "0"; + AutonomousValues.l1SW.text = "0"; + AutonomousValues.l1W.text = "0"; + + // L2 coral + AutonomousValues.l2A.text = "0"; + AutonomousValues.l2B.text = "0"; + AutonomousValues.l2C.text = "0"; + AutonomousValues.l2D.text = "0"; + AutonomousValues.l2E.text = "0"; + AutonomousValues.l2F.text = "0"; + AutonomousValues.l2G.text = "0"; + AutonomousValues.l2H.text = "0"; + AutonomousValues.l2I.text = "0"; + AutonomousValues.l2J.text = "0"; + AutonomousValues.l2K.text = "0"; + AutonomousValues.l2L.text = "0"; + + // L3 coral + AutonomousValues.l3A.text = "0"; + AutonomousValues.l3B.text = "0"; + AutonomousValues.l3C.text = "0"; + AutonomousValues.l3D.text = "0"; + AutonomousValues.l3E.text = "0"; + AutonomousValues.l3F.text = "0"; + AutonomousValues.l3G.text = "0"; + AutonomousValues.l3H.text = "0"; + AutonomousValues.l3I.text = "0"; + AutonomousValues.l3J.text = "0"; + AutonomousValues.l3K.text = "0"; + AutonomousValues.l3L.text = "0"; + + // L4 coral + AutonomousValues.l4A.text = "0"; + AutonomousValues.l4B.text = "0"; + AutonomousValues.l4C.text = "0"; + AutonomousValues.l4D.text = "0"; + AutonomousValues.l4E.text = "0"; + AutonomousValues.l4F.text = "0"; + AutonomousValues.l4G.text = "0"; + AutonomousValues.l4H.text = "0"; + AutonomousValues.l4I.text = "0"; + AutonomousValues.l4J.text = "0"; + AutonomousValues.l4K.text = "0"; + AutonomousValues.l4L.text = "0"; + } + } diff --git a/lib/utils/data/values/CommentValues.dart b/lib/utils/data/values/CommentValues.dart index f3b4b9e..c9d0b10 100644 --- a/lib/utils/data/values/CommentValues.dart +++ b/lib/utils/data/values/CommentValues.dart @@ -10,4 +10,12 @@ class CommentValues { TextEditingController(text: ""); static final TextEditingController endgameComments = TextEditingController(text: ""); + + + static void resetComments() { + CommentValues.autoComments.text = ""; + CommentValues.autoOrder.text = ""; + CommentValues.teleopComments.text = ""; + CommentValues.endgameComments.text = ""; + } } diff --git a/lib/utils/data/values/EndgameValues.dart b/lib/utils/data/values/EndgameValues.dart index c50477c..3b60c7e 100644 --- a/lib/utils/data/values/EndgameValues.dart +++ b/lib/utils/data/values/EndgameValues.dart @@ -10,4 +10,14 @@ 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(); + } + } diff --git a/lib/utils/data/values/TeleoperatedValues.dart b/lib/utils/data/values/TeleoperatedValues.dart index ccf1381..ae73d6e 100644 --- a/lib/utils/data/values/TeleoperatedValues.dart +++ b/lib/utils/data/values/TeleoperatedValues.dart @@ -18,4 +18,23 @@ class TeleoperatedValues { static TextEditingController humanPlayerMisses = TextEditingController(text: "0"); static TextEditingController fieldCrosses = TextEditingController(text: "0"); + + + static void resetTeleopValues() { + TeleoperatedValues.coralNearL1.text = "0"; + TeleoperatedValues.coralNearL2.text = "0"; + TeleoperatedValues.coralNearL3.text = "0"; + TeleoperatedValues.coralNearL4.text = "0"; + TeleoperatedValues.coralFarL1.text = "0"; + TeleoperatedValues.coralFarL2.text = "0"; + TeleoperatedValues.coralFarL3.text = "0"; + TeleoperatedValues.coralFarL4.text = "0"; + TeleoperatedValues.coralMissed.text = "0"; + TeleoperatedValues.algaeRemoved.text = "0"; + TeleoperatedValues.algaeProcessor.text = "0"; + TeleoperatedValues.algaeBarge.text = "0"; + TeleoperatedValues.humanPlayerMisses.text = "0"; + TeleoperatedValues.fieldCrosses.text = "0"; + } + } diff --git a/lib/utils/helpers/AppDataHelper.dart b/lib/utils/helpers/AppDataHelper.dart index 90efa81..f62bb60 100644 --- a/lib/utils/helpers/AppDataHelper.dart +++ b/lib/utils/helpers/AppDataHelper.dart @@ -3,7 +3,11 @@ import 'dart:io'; import 'package:permission_handler/permission_handler.dart'; import 'package:scouting_platform/utils/data/constants/AppConstants.dart'; +import 'package:scouting_platform/utils/data/values/AutonomousValues.dart'; +import 'package:scouting_platform/utils/data/values/CommentValues.dart'; +import 'package:scouting_platform/utils/data/values/EndgameValues.dart'; import 'package:scouting_platform/utils/data/values/SettingValues.dart'; +import 'package:scouting_platform/utils/data/values/TeleoperatedValues.dart'; class AppDataHelper { // Save the current event ID to a file called "current_event_id.txt" @@ -32,4 +36,12 @@ class AppDataHelper { throw Exception('Permission denied'); } } + + static void resetStates() { + AutonomousValues.resetAutoEtcValues(); + AutonomousValues.resetAutoReef(); + TeleoperatedValues.resetTeleopValues(); + EndgameValues.resetEndgameValues(); + CommentValues.resetComments(); + } } diff --git a/lib/utils/helpers/QRCodeHelper.dart b/lib/utils/helpers/QRCodeHelper.dart index 03f59c0..6005a18 100644 --- a/lib/utils/helpers/QRCodeHelper.dart +++ b/lib/utils/helpers/QRCodeHelper.dart @@ -44,49 +44,93 @@ class QrcodeHelper { /// Computes all autonomous values and returns them as a single string separated by a caret static String computeAutonomousValues() { return computeValues([ - parseInt(AutonomousValues.autoSpeakerScored.text), // index: 4 - parseInt(AutonomousValues.autoSpeakerMissed.text), // index: 5 - parseInt(AutonomousValues.autoAmpScored.text), // index: 6 - parseInt(AutonomousValues.autoAmpMissed.text), // index: 7 - parseString(AutonomousValues.autoMobility.text) // index: 8 + // L1 Coral Values + parseInt(AutonomousValues.l1NW.text), // index 4 + parseInt(AutonomousValues.l1NE.text), // index 5 + parseInt(AutonomousValues.l1W.text), // index 6 + parseInt(AutonomousValues.l1E.text), // index 7 + parseInt(AutonomousValues.l1SW.text), // index 8 + parseInt(AutonomousValues.l1SE.text), // index 9 + + // L2 Coral Values + parseInt(AutonomousValues.l2A.text), // index 10 + parseInt(AutonomousValues.l2B.text), // index 11 + parseInt(AutonomousValues.l2C.text), // index 12 + parseInt(AutonomousValues.l2D.text), // index 13 + parseInt(AutonomousValues.l2E.text), // index 14 + parseInt(AutonomousValues.l2F.text), // index 15 + parseInt(AutonomousValues.l2G.text), // index 16 + parseInt(AutonomousValues.l2H.text), // index 17 + parseInt(AutonomousValues.l2I.text), // index 18 + parseInt(AutonomousValues.l2J.text), // index 19 + parseInt(AutonomousValues.l2K.text), // index 20 + parseInt(AutonomousValues.l2L.text), // index 21 + + // L3 Coral Values + parseInt(AutonomousValues.l3A.text), // index 22 + parseInt(AutonomousValues.l3B.text), // index 23 + parseInt(AutonomousValues.l3C.text), // index 24 + parseInt(AutonomousValues.l3D.text), // index 25 + parseInt(AutonomousValues.l3E.text), // index 26 + parseInt(AutonomousValues.l3F.text), // index 27 + parseInt(AutonomousValues.l3G.text), // index 28 + parseInt(AutonomousValues.l3H.text), // index 29 + parseInt(AutonomousValues.l3I.text), // index 30 + parseInt(AutonomousValues.l3J.text), // index 31 + parseInt(AutonomousValues.l3K.text), // index 32 + parseInt(AutonomousValues.l3L.text), // index 33 + + // L4 Coral Values + parseInt(AutonomousValues.l3A.text), // index 34 + parseInt(AutonomousValues.l3B.text), // index 35 + parseInt(AutonomousValues.l3C.text), // index 36 + parseInt(AutonomousValues.l3D.text), // index 37 + parseInt(AutonomousValues.l3E.text), // index 38 + parseInt(AutonomousValues.l3F.text), // index 39 + parseInt(AutonomousValues.l3G.text), // index 40 + parseInt(AutonomousValues.l3H.text), // index 41 + parseInt(AutonomousValues.l3I.text), // index 42 + parseInt(AutonomousValues.l3J.text), // index 43 + parseInt(AutonomousValues.l3K.text), // index 44 + parseInt(AutonomousValues.l3L.text), // index 45 ]); } /// Computes all teleoperated values and returns them as a single string separated by a caret static String computeTeleopValues() { return computeValues([ - parseInt(TeleoperatedValues.coralNearL1.text), // index: 9 - parseInt(TeleoperatedValues.coralNearL2.text), // index: 10 - parseInt(TeleoperatedValues.coralNearL3.text), // index: 11 - parseInt(TeleoperatedValues.coralNearL4.text), // index: 12 - parseInt(TeleoperatedValues.coralFarL1.text), // index: 9 - parseInt(TeleoperatedValues.coralFarL2.text), // index: 10 - parseInt(TeleoperatedValues.coralFarL3.text), // index: 11 - parseInt(TeleoperatedValues.coralFarL4.text), // index: 12 - parseInt(TeleoperatedValues.coralMissed.text), // index: 13 - parseInt(TeleoperatedValues.algaeRemoved.text), // index: 14 - parseInt(TeleoperatedValues.algaeProcessor.text), // index: 15 - parseInt(TeleoperatedValues.algaeBarge.text), // index: 16 - parseInt(TeleoperatedValues.humanPlayerMisses.text), // index: 17 - parseInt(TeleoperatedValues.fieldCrosses.text), // index: 18 + parseInt(TeleoperatedValues.coralNearL1.text), // index: 46 + parseInt(TeleoperatedValues.coralNearL2.text), // index: 47 + parseInt(TeleoperatedValues.coralNearL3.text), // index: 48 + parseInt(TeleoperatedValues.coralNearL4.text), // index: 49 + parseInt(TeleoperatedValues.coralFarL1.text), // index: 50 + parseInt(TeleoperatedValues.coralFarL2.text), // index: 51 + parseInt(TeleoperatedValues.coralFarL3.text), // index: 52 + parseInt(TeleoperatedValues.coralFarL4.text), // index: 53 + parseInt(TeleoperatedValues.coralMissed.text), // index: 54 + parseInt(TeleoperatedValues.algaeRemoved.text), // index: 55 + parseInt(TeleoperatedValues.algaeProcessor.text), // index: 56 + parseInt(TeleoperatedValues.algaeBarge.text), // index: 57 + parseInt(TeleoperatedValues.humanPlayerMisses.text),// index: 58 + parseInt(TeleoperatedValues.fieldCrosses.text), // index: 59 ]); } /// Computes all endgame values and returns them as a single string separated by a caret static String computeEndgameValues() { return computeValues([ - parseString(EndgameValues.endgame.text), // index: 19 - parseString(EndgameValues.climbTime.text), // index: 20 + parseString(EndgameValues.endgame.text), // index: 60 + parseString(EndgameValues.climbTime.text), // index: 61 ]); } /// Computes all comment values and returns them as a single string separated by a caret static String computeCommentValues() { return computeValues([ - parseString(stripEmoji(CommentValues.autoComments.text)), // index: 17 - parseString(stripEmoji(CommentValues.autoOrder.text)), // index: 18 - parseString(stripEmoji(CommentValues.teleopComments.text)), // index: 19 - parseString(stripEmoji(CommentValues.endgameComments.text)) // index: 20 + parseString(stripEmoji(CommentValues.autoComments.text)), // index: 62 + parseString(stripEmoji(CommentValues.autoOrder.text)), // index: 63 + parseString(stripEmoji(CommentValues.teleopComments.text)), // index: 64 + parseString(stripEmoji(CommentValues.endgameComments.text)) // index: 65 ]); } @@ -95,7 +139,7 @@ class QrcodeHelper { return computeValues([ parseString(OptionConstants.availableDriverstations .indexOf(SettingValues.selectedDriverStation.text) - .toString()) // index: 26 + .toString()) // index: 66 ]); } @@ -116,6 +160,7 @@ class QrcodeHelper { /// Removes any character that is not a letter, number, whitespace or a special character static String stripEmoji(String value) { - return value.replaceAll(RegExp("[^A-z0-9.,\\-';/?!()[\\]+=\\s@#\$%&*~]"), ''); + return value.replaceAll( + RegExp("[^A-z0-9.,\\-';/?!()[\\]+=\\s@#\$%&*~]"), ''); } } diff --git a/pubspec.yaml b/pubspec.yaml index e49174e..50788ea 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A scouting platform app designed to track FRC robot performance. # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -30,7 +30,6 @@ dependencies: flutter: sdk: flutter - # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 @@ -63,11 +62,15 @@ flutter_launcher_icons: # The following section is specific to Flutter. flutter: assets: - # App icons, banners, and logos + # App icons, banners, and logos - assets/images/app_icon.png - assets/images/nav_banner.png - assets/images/simbotics_logo.png - # QR code centerfolds + # Reefscape diagram + - assets/images/reefscape/karthik-reef-diagram-top-shorter.png + - assets/images/reefscape/karthik-reef-diagram-middle-compressed.png + - assets/images/reefscape/karthik-reef-diagram-bottom-shorter.png + # QR code centerfolds - assets/images/centerfolds/jqr_code_centerfold.png - assets/images/centerfolds/jimmy_centerfold.png - assets/images/centerfolds/peppa_pig_centerfold.png