Skip to content

Commit

Permalink
Minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MohEsmail143 committed Jul 12, 2023
1 parent 318ef79 commit fae0a97
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 27 deletions.
2 changes: 2 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"


android {
namespace "com.example.coach_ai"
compileSdkVersion flutter.compileSdkVersion
Expand Down Expand Up @@ -70,3 +71,4 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
apply plugin: 'com.google.gms.google-services'
39 changes: 39 additions & 0 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "678883326424",
"project_id": "gradproject-2531f",
"storage_bucket": "gradproject-2531f.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:678883326424:android:6e1b42f38e056cab6f1aad",
"android_client_info": {
"package_name": "com.example.coach_ai"
}
},
"oauth_client": [
{
"client_id": "678883326424-bmlg9tmdq9rvr3rb695f8o2vhlidec4n.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBZLKu4d-9CacQvO66ak06AeJQqvat67bM"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "678883326424-bmlg9tmdq9rvr3rb695f8o2vhlidec4n.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
2 changes: 2 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ buildscript {

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

}
}

Expand Down
10 changes: 6 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ import 'package:firebase_auth/firebase_auth.dart';
import 'package:coach_ai/screens/welcome_screen.dart';
import 'firebase_options.dart';

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:coach_ai/screens/IntroPage.dart';

import 'package:coach_ai/screens/home_screen.dart';
import 'package:firebase_core/firebase_core.dart';

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
await Firebase.initializeApp();
runApp(const MyApp());
}

Expand All @@ -35,8 +37,8 @@ class MyApp extends StatelessWidget {
if (snapshot.hasData) {
return const HomeScreen();
} else {
return WelcomeScreen();
// return IntroPage();
//return WelcomeScreen();
return IntroPage();
}
},
),
Expand Down
8 changes: 4 additions & 4 deletions lib/screens/IntroPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ class _IntroPageState extends State<IntroPage> {
backgroundColor: MaterialStateProperty.all<Color>(
Colors.green), // set the background color
padding: MaterialStateProperty.all<EdgeInsets>(
EdgeInsets.all(20)), // set the padding
EdgeInsets.all(10)), // set the padding
textStyle: MaterialStateProperty.all<TextStyle>(
TextStyle(fontSize: 23)), // set the text style
fixedSize: MaterialStateProperty.all<Size>(Size(20, 50)),
TextStyle(fontSize: 20)), // set the text style
fixedSize: MaterialStateProperty.all<Size>(Size(25, 50)),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius:
Expand All @@ -82,7 +82,7 @@ class _IntroPageState extends State<IntroPage> {
child: Text('Sign up', style: TextStyle(color: Colors.white)),
style: ButtonStyle(
padding: MaterialStateProperty.all<EdgeInsets>(
EdgeInsets.all(20)), // set the padding
EdgeInsets.all(10)), // set the padding
textStyle: MaterialStateProperty.all<TextStyle>(
TextStyle(fontSize: 23)), // set the text style
fixedSize: MaterialStateProperty.all<Size>(Size(20, 50)),
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/home_view_screen.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'package:coach_ai/screens/exercise_selection_screen.dart';
import 'package:coach_ai/screens/nutrition_screen.dart';

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:curved_navigation_bar/curved_navigation_bar.dart';
import 'nutrition_screen.dart';
import 'profile_screen.dart';
import 'bmi/calculate_bmi.dart';
import '../utils/exercise.dart';
Expand Down
17 changes: 4 additions & 13 deletions lib/screens/signup_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ class SignUpScreen extends StatefulWidget {

class _SignUpScreenState extends State<SignUpScreen> {
final TextEditingController _emailController = TextEditingController();
final TextEditingController _usernameController = TextEditingController();

final TextEditingController _passwordController = TextEditingController();
final TextEditingController _confirmPasswordController =
TextEditingController();


@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -56,11 +55,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
fontWeight: FontWeight.bold,
)),
),
CustomizedTextfield(
myController: _usernameController,
hintText: "Username",
isPassword: false,
),

CustomizedTextfield(
myController: _emailController,
hintText: "Email",
Expand All @@ -71,11 +66,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
hintText: "Password",
isPassword: true,
),
CustomizedTextfield(
myController: _confirmPasswordController,
hintText: "Confirm Password",
isPassword: true,
),

CustomizedButton(
buttonText: "Register",
buttonColor: Colors.black,
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/camera/rep_counter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RepCounter {
/// form of "Warmup Mode"
void warmup(List<int> warmupInferences) {
// Extracting min and max altitudes from list of inferences
warmupInferences = warmupInferences.sublist(25);
warmupInferences = warmupInferences.sublist(30);
minAltitude = warmupInferences.reduce(min);
maxAltitude = warmupInferences.reduce(max);

Expand Down
4 changes: 2 additions & 2 deletions lib/utils/exercise.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ final List<Exercise> availableExercises = [
],
image: "assets/images/push_up.png",
gif: 'assets/images/push_up.gif',
trackedKeypoint: kKeypointDict['right_shoulder'] as int,
trackedKeypoint: kKeypointDict['left_shoulder'] as int,
trackingDirection: 0,
fullRepPosition: true,
formCorrectnessModel: 'models/pushUp_version2.tflite',
targetedMuscles: ['Chest', 'Triceps', 'Shoulders'],
cameraInstructions: [
"For this exercise, you need to place your phone in a landscape orientation.",
"While exercising, your phone needs to be in a stable position (i.e. not move).",
"Your phone's camera should be able to view your entire body's right side, specially your right shoulder, since we use it to track your reps.",
"Your phone's camera should be able to view your entire body's left side, specially your left shoulder, since we use it to track your reps.",
"Start a warmup for 15 seconds. This is necessary for our AI to calculate some statistics off your body.",
"Once you're done with your warmup, you should be able to start your workout.",
"Once you have started a set, you should perform the required number of reps.",
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,10 @@ packages:
dependency: transitive
description:
name: google_sign_in_android
sha256: "258864d68b68f2b2846c10283b7afb95f26ff3307c410a2841a010d034b65439"
sha256: "8d60a787b29cb7d2bcf29230865f4a91f17323c6ac5b6b9027a6418e48d9ffc3"
url: "https://pub.dev"
source: hosted
version: "6.1.17"
version: "6.1.18"
google_sign_in_ios:
dependency: transitive
description:
Expand Down

0 comments on commit fae0a97

Please sign in to comment.