Skip to content

2025 Restructure (DNM) #54

New issue

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

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

Already on GitHub? Sign in to your account

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ A guide that documents the process of configuring advances parts of the scouting
- `prematch` - Contains fields for initials, match number, and team number, and automatically selects the team based on the match number and driver station configured in the settings.
*All inputs on this page feed into the `lib/utils/data/values/PrematchValues.dart` values.*
- `qrcode` - Contains routes for scanning QR codes and managing related data for creating or saving them.
- `settings` - Provides the settings route where users configure event ID, QR code centerfold, team number editability, and other important settings for app functionality.
- `settings` - Provides the settings route where users configure event ID, team number editability, and other important settings for app functionality.
*All inputs on this page feed into the `lib/utils/data/values/SettingValues.dart` values.*
- `styles` - Contains widgets for easily generating headers and titles, as well as a set of colors used throughout the app to maintain uniformity in the scouting platform.
- `utils` - Includes utilities like constants, value files, and helpers to support app functionality.
Expand Down
16 changes: 6 additions & 10 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,10 +22,6 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion "25.1.8937393"
Expand Down Expand Up @@ -69,5 +66,4 @@ flutter {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
13 changes: 0 additions & 13 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
Expand Down
32 changes: 22 additions & 10 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
// id "com.android.application" version "8.3.2" apply false
// id "org.jetbrains.kotlin.android" version "2.0.20" apply false
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.4.2" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}

include ":app"
Binary file not shown.
Binary file removed assets/images/centerfolds/bruh_centerfold.png
Binary file not shown.
Binary file removed assets/images/centerfolds/cheese.png
Binary file not shown.
Binary file removed assets/images/centerfolds/huh_centerfold.png
Binary file not shown.
Binary file removed assets/images/centerfolds/hungwy_centerfold.png
Binary file not shown.
Binary file removed assets/images/centerfolds/jimmy_centerfold.png
Binary file not shown.
Binary file removed assets/images/centerfolds/jqr_code_centerfold.png
Binary file not shown.
Binary file not shown.
Binary file removed assets/images/centerfolds/peppa_pig_centerfold.png
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions lib/builders/bases/CustomCheckbox.dart
Original file line number Diff line number Diff line change
@@ -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<CustomCheckbox> createState() => _CustomCheckboxState();
}

class _CustomCheckboxState extends State<CustomCheckbox> {
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,
),
),
],
),
);
}
}
88 changes: 51 additions & 37 deletions lib/builders/bases/StopwatchButton.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
// ignore_for_file: file_names
import 'package:scouting_platform/styles/AppStyle.dart';
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:scouting_platform/styles/AppStyle.dart';

/// THIS CLASS IS DEPRECATED AND IS NO LONGER SUPPORTED FOR USE
/// Please refer to previous years of for usage of this class
/// NO SUPPORT WILL BE PROVIDED FOR THIS CLASSES USAGE
class StopwatchButton extends StatefulWidget {
final TextEditingController value;
final TextEditingController state;
final Stopwatch timer;

const StopwatchButton({
super.key,
required this.value,
required this.state,
required this.timer,
});

Expand All @@ -22,6 +18,23 @@ class StopwatchButton extends StatefulWidget {
}

class _StopwatchButtonState extends State<StopwatchButton> {
Timer? _updateTimer;

@override
void dispose() {
_updateTimer?.cancel();
super.dispose();
}

void startUpdatingUI() {
_updateTimer?.cancel();
_updateTimer = Timer.periodic(const Duration(milliseconds: 100), (_) {
if (mounted) {
setState(() {});
}
});
}

@override
Widget build(BuildContext context) {
return Container(
Expand All @@ -32,49 +45,50 @@ class _StopwatchButtonState extends State<StopwatchButton> {
backgroundColor: AppStyle.textInputColor,
shape: const ContinuousRectangleBorder(),
),
onLongPress: () {
widget.timer.stop();
widget.timer.reset();
_updateTimer?.cancel();
setState(() {});
},
onPressed: () {
if (int.parse(widget.state.text) == 1) {
setState(() {
widget.timer.stop();
widget.state.text = "2";
widget.value.text = returnFormattedText();
});
} else if (int.parse(widget.state.text) == 2) {
setState(() {
widget.state.text = "3";
});
} else if (int.parse(widget.state.text) == 3) {
setState(() {
widget.timer.reset();
widget.state.text = "0";
});
if (!widget.timer.isRunning) {
widget.timer.start();
startUpdatingUI();
} else {
setState(() {
widget.timer.start();
widget.state.text = "1";
});
widget.timer.stop();
_updateTimer?.cancel();
widget.value.text = widget.timer.elapsedMilliseconds.toString();
}
setState(() {});
},
child: Text(returnFormattedText(),
style: const TextStyle(
fontSize: 16.0, fontFamily: "Helvetica", color: Colors.white)),
child: Text(
returnFormattedText(),
style: const TextStyle(
fontSize: 16.0, fontFamily: "Helvetica", color: Colors.white),
textAlign: TextAlign.center,
),
),
);
}

String returnFormattedText() {
int milli = widget.timer.elapsed.inMilliseconds;

if (milli == 0) {
return "Start Timer";
} else if (int.parse(widget.state.text) == 1) {
return "Stop Timer";
}
String formattedTime = returnFormattedTime();
return widget.timer.isRunning
? "Running... \n $formattedTime"
: "Start Timer \n $formattedTime";
}

String milliseconds = (milli % 1000).toString().padLeft(1, "0");
String returnFormattedTime() {
int milli = widget.timer.elapsedMilliseconds;
String milliseconds = (milli % 1000).toString().padLeft(3, "0");
String seconds = ((milli ~/ 1000) % 60).toString().padLeft(2, "0");
String minutes = ((milli ~/ 1000) ~/ 60).toString().padLeft(1, "0");
String minutes = ((milli ~/ 1000) ~/ 60).toString().padLeft(2, "0");

return "$minutes:$seconds:$milliseconds";
}

int returnTime() {
return widget.timer.elapsedMicroseconds;
}
}
18 changes: 9 additions & 9 deletions lib/components/navigation/NavigationSidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
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/data/DataRoute.dart';
import 'package:scouting_platform/routes/qrcode/DriverStationScanStatusRoute.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';
import 'package:scouting_platform/routes/teleop/TeleopRoute.dart';

class NavigationSidebar extends StatelessWidget {
const NavigationSidebar({super.key});
Expand All @@ -33,9 +33,13 @@ class NavigationSidebar extends StatelessWidget {
itemName: "Prematch Data",
route: PrematchRoute(title: 'Prematch Data')),
const SidebarItem(
icon: Icon(Icons.draw),
itemName: "Data Input",
route: DataRoute(title: 'Data Input')),
icon: Icon(Icons.auto_awesome),
itemName: "Auto Data",
route: AutonomousDataRoute(title: 'Auto Input')),
const SidebarItem(
icon: Icon(Icons.gamepad),
itemName: "Teleop Data",
route: TeleopRoute(title: 'Teleop Input')),
const SidebarItem(
icon: Icon(Icons.chat_bubble),
itemName: "Comments",
Expand All @@ -45,10 +49,6 @@ class NavigationSidebar extends StatelessWidget {
itemName: "QR Code",
route: QRCodeRoute(title: "QR Code")),
const Divider(),
const SidebarItem(
icon: Icon(Icons.camera_alt_outlined),
itemName: "Scanning",
route: DriverStationScanStatusRoute(title: "Scanning")),
const SidebarItem(
icon: Icon(Icons.settings),
itemName: "Settings",
Expand Down
Loading
Loading