Skip to content

Commit

Permalink
Merge pull request #53 from Ammar-Raneez/dev
Browse files Browse the repository at this point in the history
sdgp final submission
  • Loading branch information
Ammar-Raneez authored Apr 23, 2021
2 parents ddcd603 + 03636e1 commit ba45431
Show file tree
Hide file tree
Showing 75 changed files with 3,128 additions and 2,869 deletions.
4 changes: 2 additions & 2 deletions api/diagnosis/breast-deployment/breastmodelsdgp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import numpy as np
import tensorflow as tf
from .breastDiagModule import BreastDiagModule

import logging
breastDiagModule = BreastDiagModule()

scriptpath = os.path.abspath(__file__)
scriptdir = os.path.dirname(scriptpath)
BREAST_MODEL_PATH = os.path.join(scriptdir, 'breast_model.h5')

# Calculate Prediction Percentage of result (cancer / normal percentage)
# Calculate Prediction Percentage of result cancer
def calculate_prediction_percent_breast(prediction, result):
return str(np.amax(prediction[0][0] * 100))

Expand Down
File renamed without changes
File renamed without changes
Binary file added ui/images/deadlift.gif
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 ui/images/exerciseImages/highknees.jpg
Binary file not shown.
Binary file removed ui/images/exerciseImages/squats.jpg
Binary file not shown.
Binary file added ui/images/highknees.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ui/images/jacks.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added ui/images/legstretch.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added ui/images/pullups.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added ui/images/squats.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ui/images/thighlunges.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
29 changes: 19 additions & 10 deletions ui/lib/components/alert_widget.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:ui/components/reports_card.dart';
import 'package:ui/screens/Personal%20Manager/reportManager/diagnosis_reports_screen.dart';
import 'package:ui/screens/Personal%20Manager/reportManager/prognosis_reports_screen.dart';
import 'package:ui/screens/Personal%20Manager/reportManager/report_widgets/ReportListWidget.dart';
import 'package:ui/screens/current_screen.dart';
import 'package:ui/screens/settings_screen.dart';

// ignore: must_be_immutable
class AlertWidget extends StatelessWidget {
// Variables
final String title;
Expand Down Expand Up @@ -54,7 +52,9 @@ class AlertWidget extends StatelessWidget {
borderSide: BorderSide(color: Colors.red),
),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0xFF637477)),
borderSide: BorderSide(
color: Color(0xFF637477),
),
),
),
);
Expand Down Expand Up @@ -122,22 +122,29 @@ class AlertWidget extends StatelessWidget {
Navigator.pop(context); // pop the alert
Navigator.push(
context,
MaterialPageRoute(builder: (context) => DiagnosisReports()),
MaterialPageRoute(
builder: (context) => DiagnosisReports(),
),
);
}
else if (_status == 202) {
} else if (_status == 203) {
// Remove the alert widget and direct to prognosis report list
Navigator.pop(context); // pop the alert
Navigator.push(
context,
MaterialPageRoute(builder: (context) => PrognosisReports()),
MaterialPageRoute(
builder: (context) => PrognosisReports(),
),
);
}

if (_status == 200) {
Navigator.pop(context); // pop the alert
Navigator.push(context,
MaterialPageRoute(builder: (_) => PrognosisReports()));
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => CurrentScreen(),
),
);
} else if (confirmChangePrimitiveWrapper != null) {
confirmChangePrimitiveWrapper.setConfirmChange(true);
Navigator.pop(context);
Expand Down Expand Up @@ -209,8 +216,10 @@ class TextPrimitiveWrapper {

TextPrimitiveWrapper(this._text);

// ignore: unnecessary_getters_setters
String get text => _text;

// ignore: unnecessary_getters_setters
set text(String value) {
_text = value;
}
Expand Down
26 changes: 17 additions & 9 deletions ui/lib/components/cancer_card.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'package:flutter/material.dart';

//TODO - need to add functionality for passing colors into card, add font and finishing touches.

// This is the Cancer Card generator that accepts parameters to build a custom card for each cancer

class CancerCard extends StatelessWidget {
Expand All @@ -11,7 +9,11 @@ class CancerCard extends StatelessWidget {
final String cardColor2;
final String textColor;

CancerCard({@required this.cardTitle, @required this.cardColor,@required this.cardColor2, @required this.textColor}); //constructor to init values
CancerCard(
{@required this.cardTitle,
@required this.cardColor,
@required this.cardColor2,
@required this.textColor}); //constructor to init values

@override
Widget build(BuildContext context) {
Expand All @@ -20,15 +22,21 @@ class CancerCard extends StatelessWidget {
borderRadius: BorderRadius.circular(18),
gradient: LinearGradient(
colors: [
Color(int.parse(cardColor)),
Color(int.parse(cardColor2)),
Color(
int.parse(cardColor),
),
Color(
int.parse(cardColor2),
),
],
begin: Alignment(1.2,1),
end: Alignment(0.8,-2),
begin: Alignment(1.2, 1),
end: Alignment(0.8, -2),
),
boxShadow: [
BoxShadow(
color: Color(int.parse(cardColor)).withOpacity(0.5),
color: Color(
int.parse(cardColor),
).withOpacity(0.5),
spreadRadius: 3,
blurRadius: 15,
offset: Offset(7, 9), // changes position of shadow
Expand All @@ -52,4 +60,4 @@ class CancerCard extends StatelessWidget {
),
);
}
}
}
1 change: 1 addition & 0 deletions ui/lib/components/chatbot_message_bubble.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:ui/constants.dart';

// bot message bubbles
class MessageBubble extends StatelessWidget {
final String messageSender;
final String messageText;
Expand Down
65 changes: 26 additions & 39 deletions ui/lib/components/custom_app_bar.dart
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
import 'package:flutter/material.dart';
import 'package:ui/screens/settings_screen.dart';


// ignore: must_be_immutable
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {

var iconButton; // This Variable holds the Icon type required for the left part of the App Bar
// Constructor for the RoundedAppBar Component
CustomAppBar.arrow(BuildContext context) {

this.iconButton = new IconButton(

icon: Icon(Icons.arrow_back_sharp,
this.iconButton = new IconButton(
icon: Icon(
Icons.arrow_back_sharp,
color: Colors.white,
size: 25.0,),
onPressed: () {
Navigator.pop(context);
},
);
size: 25.0,
),
onPressed: () {
Navigator.pop(context);
},
);
}

CustomAppBar.settings(String userName, String email, String gender, BuildContext context) {

CustomAppBar.settings(
String userName, String email, String gender, BuildContext context) {
this.iconButton = new IconButton(
icon: Icon(Icons.settings,
icon: Icon(
Icons.settings,
color: Colors.white,
size: 25.0,),
size: 25.0,
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context)=> SettingsScreen(userName, email, gender)
builder: (context) => SettingsScreen(userName, email, gender),
),
);
},
Expand All @@ -38,41 +39,30 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {

@override
Widget build(BuildContext context) {

return new SizedBox.fromSize(


size: preferredSize,
child: ClipPath(

clipper: CustomShape(),
child: Container(

height: 120,
decoration: BoxDecoration(
color: Color(0xff01CDFA),

color: Color(0xff01CDFA),
),
child: Row(

//Setting MainAxisAlignment to spaceBetween as it creates an equal amount of space between two nodes
//Setting MainAxisAlignment to spaceBetween as it creates an equal amount of space between two nodes
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[

Container(

child: iconButton,
padding: EdgeInsets.only(left: 20, bottom: 30)),

child: iconButton,
padding: EdgeInsets.only(left: 20, bottom: 30),
),
Container(

child: Image(
image: AssetImage('images/officialLogo.png'),
width: 65),
padding: EdgeInsets.only(right: 30, bottom: 30)
child: Image(
image: AssetImage('images/officialLogo.png'), width: 65),
padding: EdgeInsets.only(right: 30, bottom: 30),
)
]
),
]),
),
),
);
Expand All @@ -83,10 +73,8 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
}

class CustomShape extends CustomClipper<Path> {

@override
getClip(Size size) {

var path = Path();
path.lineTo(0, size.height * .5);

Expand All @@ -112,7 +100,6 @@ class CustomShape extends CustomClipper<Path> {

@override
bool shouldReclip(CustomClipper oldClipper) {

return true;
}
}
59 changes: 32 additions & 27 deletions ui/lib/components/exercise_card.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@


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

// cards in exercise plan
class ExerciseCard extends StatelessWidget {

final String cardTitle;
final String cardImage;

Expand All @@ -16,39 +14,46 @@ class ExerciseCard extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.only(
left: 20,
right: 20,
bottom: 80,
right: 0,
bottom: 20,
top: 20,
),
child: Container(
child: Container(
height: 180.0,
width: 250.0,
child: Align(
alignment: Alignment.topLeft,
child:Padding(
padding: const EdgeInsets.only(left: 12.0, top: 10.0),
child: Text(
cardTitle,
style: TextStyle(
fontSize: 19.0,
color: Colors.black,
fontFamily: 'Poppins-SemiBold',
),
),
height: 180.0,
width: 250.0,
child: Align(
alignment: Alignment.topLeft,
child: Padding(
padding: const EdgeInsets.only(left: 20.0, top: 20.0),
child: Text(
cardTitle,
style: TextStyle(
fontSize: 20,
color: Colors.black,
fontFamily: 'Poppins-SemiBold',
),
),
),
decoration:BoxDecoration(
image: DecorationImage(
image: AssetImage("images/ExerciseImages/" + cardImage),
fit: BoxFit.fitHeight,
alignment: Alignment.topCenter
),
borderRadius: BorderRadius.circular(22.0),
color: Colors.white,
),
),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("images/" + cardImage),
fit: BoxFit.cover,
alignment: Alignment.topCenter),
borderRadius: BorderRadius.circular(22.0),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0xFF7D7D7D).withOpacity(0.4),
spreadRadius: 3,
blurRadius: 16,
offset: Offset(4, 9), // changes position of shadow
),
],
),
),
),
);
}
Expand Down
Loading

0 comments on commit ba45431

Please sign in to comment.