Skip to content

Commit

Permalink
Merge new app framework into the old project
Browse files Browse the repository at this point in the history
Rewrote the app to use better code and make it easier to modify

This marks beta 1.0
  • Loading branch information
awtpi314 authored Feb 24, 2022
2 parents 14f8530 + 7bcbba3 commit b5ff151
Show file tree
Hide file tree
Showing 58 changed files with 1,842 additions and 837 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cmake.configureOnOpen": false
}
29 changes: 21 additions & 8 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ if (localPropertiesFile.exists()) {
}
}

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

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.")
Expand Down Expand Up @@ -44,19 +50,26 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.awtpi314.scouting_app3"
minSdkVersion flutter.minSdkVersion
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}

flutter {
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<application
android:label="WEARs MY APP"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/app_icon.png
Binary file not shown.
259 changes: 144 additions & 115 deletions assets/config.json
Original file line number Diff line number Diff line change
@@ -1,121 +1,150 @@
{
"pre-match": [
[

{
"title": "Team Number",
"data-type": "int"
},
{
"title": "Match Number",
"data-type": "matchnum"
},
{
"title": "Scouter Name",
"data-type": "string"
}
],
"auton": [
{
"title": "Pre-Match Data",
"data": [

{
"title": "High Hub Scored",
"data-type": "counter"
},
{
"title": "Low Hub Scored",
"data-type": "counter"
},
{
"title": "Starting Location",
"data-type": "choice",
"choices": [
"1", "2", "3", "4"
]
},
{
"title": "Left Tarmac",
"data-type": "choice",
"choices": [
"Yes", "No"
]
}
],
"teleop": [
{
"title": "Team Number",
"data-type": "field",
"validation": "^[0-9]*$",
"validate-help": "This should be a valid FRC team"
},
{
"title": "Match Number",
"data-type": "field",
"validation": "^[0-9]*$",
"validate-help": "This should be a match number"
},
{
"title": "Scouter Name",
"data-type": "field",
"validation": "^[^;]*$",
"validate-help": "This cannot have semicolons in it"
}
]
},
{
"title": "Auton Data",
"data": [

{
"title": "High Hub Scored",
"data-type": "counter"
},
{
"title": "High Hub Missed",
"data-type": "counter"
},
{
"title": "Low Hub Scored",
"data-type": "counter"
},
{
"title": "Low Hub Missed",
"data-type": "counter"
},
{
"title": "Defense",
"data-type": "choice",
"choices": [
"None", "Not Effective", "Effective", "Very Effective"
]
}
],
"endgame": [
{
"title": "High Hub Scored",
"data-type": "counter"
},
{
"title": "Low Hub Scored",
"data-type": "counter"
},
{
"title": "Tarmac Image",
"data-type": "displayImage",
"location": "assets/tarmac.png"
},
{
"title": "Starting Location",
"data-type": "choice",
"choices": [
"1", "2", "3", "4"
]
},
{
"title": "Left Tarmac",
"data-type": "choice",
"choices": [
"Yes", "No"
]
}
]
},
{
"title": "Teleop Data",
"data": [

{
"title": "Hang Time",
"data-type": "stopwatch"
},
{
"title": "Hang Type",
"data-type": "choice",
"choices": [
"No Hang", "Low Rung", "Mid Rung", "High Rung", "Traversal Rung"
]
}
],
"post-match": [
{
"title": "High Hub Scored",
"data-type": "counter"
},
{
"title": "High Hub Missed",
"data-type": "counter"
},
{
"title": "Low Hub Scored",
"data-type": "counter"
},
{
"title": "Low Hub Missed",
"data-type": "counter"
},
{
"title": "Defense",
"data-type": "choice",
"choices": [
"None", "Not Effective", "Effective", "Very Effective"
]
}
]
},
{
"title": "Endgame Data",
"data": [

{
"title": "Would you pick this robot?",
"data-type": "choice",
"choices": [
"1st Pick", "2nd Pick", "No Pick"
]
},
{
"title": "Robot Role",
"data-type": "choice",
"choices": [
"Offense - Launch Pad",
"Offense - Hub Cleanup",
"Defense - Bot to Bot ",
"Defense - Launch Pad Zone",
"Defense - Center Line Zone",
"Defense - Terminal Zone",
"Defense - Circling Hub",
"Defense - Cargo Hitter"
{
"title": "Hang Time",
"data-type": "stopwatch"
},
{
"title": "Hang Type",
"data-type": "choice",
"choices": [
"No Hang", "Low Rung", "Mid Rung", "High Rung", "Traversal Rung"
]
}
]
},
{
"title": "Post-Match Data",
"data": [

]
},
{
"title": "Penalties",
"data-type": "choice",
"choices": ["Yes", "No"]
},
{
"title": "Disabled",
"data-type": "choice",
"choices": ["Yes", "No"]
},
{
"title": "General Comments",
"data-type": "string"
}
]
}
{
"title": "Would you pick this robot?",
"data-type": "choice",
"choices": [
"1st Pick", "2nd Pick", "No Pick"
]
},
{
"title": "Robot Role",
"data-type": "choice",
"choices": [
"Offense - Launch Pad",
"Offense - Hub Cleanup",
"Defense - Bot to Bot",
"Defense - Launch Pad Zone",
"Defense - Center Line Zone",
"Defense - Terminal Zone",
"Defense - Circling Hub",
"Defense - Cargo Hitter"

]
},
{
"title": "Penalties",
"data-type": "choice",
"choices": ["Yes", "No"]
},
{
"title": "Disabled",
"data-type": "choice",
"choices": ["Yes", "No"]
},
{
"title": "General Comments",
"data-type": "field",
"validation": "^[^;]*$",
"validate-help": "This cannot have semicolons in it"
}
]
}
]
Binary file added assets/icon/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -478,4 +478,4 @@
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
}
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.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
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.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
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.
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.
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.
34 changes: 34 additions & 0 deletions lib/configurator.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import 'dart:convert';

import 'package:flutter/services.dart';

class Configurator {
static Configurator? _instance;

List _data = [];

Configurator._();

static Configurator getInstance() {
_instance ??= Configurator._();
return _instance!;
}

Future<void> readConfigJson() async {
rootBundle.loadString("assets/config.json").then((response) {
_data = json.decode(response);
});
}

List getEntireData() {
return _data;
}

Map getSection(int index) {
return _data[index];
}

int getListLength() {
return _data.length;
}
}
1 change: 1 addition & 0 deletions lib/counterfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class _CounterFieldState extends State<CounterField> {

counter = widget.initialValue;
controller.text = counter.toString();
widget.callback(counter);
}

@override
Expand Down
Loading

0 comments on commit b5ff151

Please sign in to comment.