REHAPP is a rehabilitation app for stroke survivors. This app allows therapists to assign home exercise programs to their patients and view their progress. The patients can then see their assigned exercises and log their progress in the app.
- Git (https://git-scm.com/downloads)
- We recommend installing Android Studio (https://developer.android.com/studio/install). If you are on MacOS, you can also install Xcode.
- Project Installation: Install this REHAPP repository on your local machine.
- Flutter Installation: Install Flutter on your local machine.
- If you are using Android Studio, you will need to install the Flutter Plug In and Dart Plug In via Android Studio.
The link below contains screenshots and thorough instructions for Flutter and Project Installation via Android Studio for Windows PC Users. https://docs.google.com/document/d/1IuZj2MNcUqtaxMEQYJi0_f6q8ARFV24et6CWh60VYWM/edit?usp=sharing This guide is helpful for troubleshooting and includes common errors that can arise when installing Rehapp. We highly recommend reviewing this guide before proceeding.
- Clone this project and name it accordingly:
git clone https://github.com/yoshikikakehi/REHAPP.git
. If you are new to git, it isn't 100% necessary to install git in order to utilize the project. Simply download the project and unzip it wherever you want on your computer.
For general Flutter installation instructions, head on over to Flutter's official website (https://docs.flutter.dev/get-started/install) and follow the instructions based on your operating system. Below are the set of Flutter installation instructions that our team used.
- Clone the flutter repository using git clone https://github.com/flutter/flutter.git -b stable
- Add the Path to the Flutter repository to the environment variables
- Run the command flutter doctor . This command will let you know if you are missing any requirements to run flutter and provide you the corresponding installation links as needed. If you are missing any of the requirements, please follow the given instructions. For assistance on resolving this issues, we recommend visiting pages 13-20 of the "Detailed Android Studio Installation and Set Up for Windows PC Users" above. 3a. Order to resolve the issues: X Visual Studio X Intellij Idea Community Version, Download Intellij Idea Community Version with the link provided X VS Code, Download Intellij Idea VS Code with the link provided X cmdline-tools component is missing - follow Resolve x Android SDK is missing command line tools below X run flutter doctor -- android-license - follow Resolve Android License missing - Flutter Doctor
- Open Android Studio.
- Click File -> Settings
- Click Plugins.
- Type Flutter in the search bar. Select Install Flutter.
- Type Dart in the search bar. Select Install Dart.
- Follow pages 23-25 of "Detailed Android Studio Installation and Set Up for Windows PC Users" above.
For Android applications, follow this guide.
For iOS applications, follow this guide.
This section is targeted towards developers. The project structure will be broken down, and we will go over the general architecture of the application.
The folder rehapp
features the important frontend pieces of the app. Here the folders and their explanations will be given.
These folders contain platform specific details. Team 2324 did not greatly alter these folders, so they should generally be the same as when you create a new Flutter template project.
This folder contains the font we chose for Rehapp: Atkinson Hyperlegible. This font was released by the Braille Institute in an effort to increase legibility and readability among low vision readers. Read more about it here.
These folders are generally unused by Team 2324.
This folder is the most important, containing all the frontend code for the application. Let's break this down further in the next section.
Inside lib are several folders that all contain the vast majority of frontend code for the project. The folders are api
, assets
, model
, and pages
. There are also two additional files: ProgressHUD.dart
and main.dart
that do not exist within any folders. Here is an idea of how the application runs in the first place:
- Once you have run the Flutter application, the first function that ever runs is the
Future<void> main() async
function withinmain.dart
. It handles checking whether the user is still logged in based on locally stored data before the linerunApp(Phoenix(child: const MyApp()));
begins the application throughMyApp()
. - The first page you will see is
/pages/login.dart
. The/pages
folder contains all the pages or screens visible through the app. - Inside
/pages/login.dart
is a good initial view on how pages work. At the top isclass LoginPage extends StatefulWidget
which is the page that is being run, extending theStatefulWidget
class. Flutter's general structure is that it consists of widgets nested within widgets. Widgets can be anything from buttons on your screen, to text, and to the entire scaffold of the screen. TheLoginPage
class usescreateState()
to create the state of the widget viaclass _LoginPageState extends State<LoginPage>
. The flow of functions being called is:createState()
->initState()
->build(BuildContext context)
. - Inside
initState()
, we see the linerequestModel = LoginRequestModel();
. This is the first interaction with the/model
folder. Opening this folder, you will see quite a few models. These models contain all the necessary formats for both sending and receiving HTTP requests. In this case, take a look at the structure of theLoginPage()
. You will see severalTextFormField
widgets that store data within therequestModel
. - Around line 187 is our first interaction with the
/api
folder. The lineAPIService apiService = APIService();
calls the file/api/api_service.dart
. This file is the way in which Rehapp contacts its backend with HTTP requests. - Once the user is logged in and authenticated, the user's information is stored with the global variable
/api/user.dart
,/api/token.dart
, and also local storage via theshared_preferences
dependency. - Some strings within the application are held within
/assets/constants.dart
. There are also default pictures within/assets/images
, which are used for the default images for exercises. - The
ProgressHUD.dart
file is run in pages where the initialization of data requires an API call, so a loading icon is first displayed over the entire page preventing user input until everything has been loaded in. - The
api/chosen_exercise_bank.dart
file is used when the therapist wants to use an exercise bank exercise frompages/exercise_bank_detail.dart
, two pages need to be popped off the Navigator stack, so thechosenExercise
serves as a global variable to remember the details of the exercise for use later. Flutter uses a Navigator to travel between pages, keeping track of which pages are currently on the stack. You push onto the stack when you want to navigate to another page, and you pop when you want to return. In #1 of these details, we mentionedrunApp(Phoenix(child: const MyApp()));
. ThePhoenix
that wraps aroundMyApp()
is not standard: that is an outside dependency namedflutter_phoenix
which restarts the app, wiping clean all data and stacks. This is done on Logout. - Lastly, dependencies can be viewed within
rehapp/pubspec.yaml
.
- Whenever you install a new dependency by altering the
rehapp/pubspec.yaml
, make sure to restart the app if it is running. If that does not work, runningflutter clean
andflutter run
in that order should fix any issues. - If you use Visual Studio Code, you can right-click on any widget within the build() function, and select refactor. This will show a list of options where you can wrap a widget in a parent or swap it for something else.
- Sometimes, bugs like data not propagating correctly can be solved by turning the function into an async one and await'ing HTTP requests or other function calls.
Flutter
References
- Return to login page using a back button
- Upload a profile picture on the account page
- Upload personal information (email, number, role, etc.) and display it on account page
- We are currently facing an error when trying to load the exercise page for either the therapist or the patient user. This issue should be resolved by Sprint 5.
- As a patient/therapist, I want to receive a confirmation email after account creation.
- As a patient/therapist, I want to be able to reset my password.
- As a therapist, I want a safety box to appear on the patient’s end that confirms that the patient is not at any safety risk and has the appropriate supervision required to complete the exercises.
- As a therapist, I want my patient to be able to rate the completed exercise with a point system, so it is easier for me to review.
- Migration from Azure to Firebase has been successfully completed. Exercises can be assigned as a therapist to a patient. All of this is done using Firebase.
- Main branch has errors rendering the login page that need to be resolved.
- Issues with accessing fields such as images of exercises that no longer exist.
Note: The implementation of new features are repeated in the v0.1.0 release notes, as we are in the process of migrating from Azure to Firebase.
- Create an account as either a therapist or patient
- Log in with created credentials
- Add a patient via email
- View list of patients
- Delete a patient
- Assign an exercise to a patient (details shown in v0.1.0 release notes)
- Migration from Azure to Firebase has successfully began. We will continue to re-implement current features in Sprint 3.
- When a therapist attempts to add a patient that does not exist, the error message that displays is unclear.
- Click a "Remember Me" checkbox during login
- Currently, the previous Azure database service is expired. By Sprint 2, a new database should be configured.
- View incomplete assigned exercises
- Includes name, description, expected time to complete, optional photo, and optional video
- Submit feedback to therapist including: minutes spent on exercise, difficulty level (ie: easy, moderate, hard), and optional comments
- Voice dictation to leave optional comments instead of typing with keyboard
- View completed assigned exercises
- View old response to the exercises
- Submit new response to therapist on already completed exercises
- Add a patients to roster
- Remove a patient from roster
- Search for a patient by name
- View specific patient’s incomplete assigned exercises
- View specific patient’s complete assigned exercises
- Shows patient's feedback
- Search for a patient’s assigned exercise by name
- Remove a patient’s assigned exercise
- Assign patient a new exercise
- Custom exercise
- Enter name, description, expected time to complete, days assigned to complete (ie: mondays and wednesdays), optional image, and optional video demonstration
- Exercise bank
- Select from a list of common exercises
- Name, description, expected time, image and video are autofilled
- Enter days assigned to complete (ie: tuesdays and thursdays)
- Optionally edit the autofilled information to better fit the patient’s needs
- Custom exercise
Fixed Bugs
- Null Video Link in the getPatientAssignments and getAssignedExercises APIs
- Broken Picture Link in the database
Known Bugs
- The status bar changes to white and stays white after the assign exercise page, making it difficult to read on other pages (it may change back)
Missing Features (Incompleted Stretch Goals)
- Calendar tab feature
- Push notifications
- Two factor authentication
- Login via 3rd party (ie: facebook, gmail, etc)
- Forgot your password feature
- Account tab feature (currently the account tab leads to logout)
- Embedded video player
Name | Role |
---|---|
Minhat Mustafa | Backend, Manager |
Kiran Nazarali | Backend |
Nabeeha Nuba | Frontend, Communicator |
Hira Shahzad | Backend |
Yoshiki Kakehi | Frontend, Backend |