Skip to content

Commit a2d5db7

Browse files
Small change to the tutorial view and renaming one color in the stretch_colors.dart. Also adding a markdown file regarind this app with some documentation
1 parent 248f541 commit a2d5db7

File tree

5 files changed

+73
-15
lines changed

5 files changed

+73
-15
lines changed

README-Abgabe.txt

-8
This file was deleted.

StretchApp.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Guided Neck Stretch App
2+
3+
## Goal
4+
This App is used to allow users to easily start a stretching exercise for their neck without a lot of trouble. To ensure that the user doesn't have to look at the screen while enjoying their stretching session, it also has a stats tab which displays valuable information to be viewed after they just stretched. Furthermore the app signals to the user whenever the next stretching session starts and when a break is occuring, so that the user can stay calm and close his eyes without focusing on his own set time constraints.
5+
To ensure a more intimate experience the user can also set his own threshold goals and stretching duration for each of the stretch exercises, and modify the break times in between. If a user is new or unsure how to use this app or to execute the stretch exercises in the right manner, a guide tab is provided to help the user understand the app and it's UI and to show them a video regarding the used stretch exercises.
6+
7+
## Assets
8+
The assets are modified images from the posture tracker app to ensure consistency within the OpenEarable app. These images always display the stretched area with a blue indicator color.
9+
- `Neck_Stretch_Left.png`: Image displaying the neck with indicators of a "left stretch".
10+
- `Neck_Main_Stretch.png`: Image displaying the neck with indicators of a "main stretch".
11+
- `Neck_Right_Stretch.png`: Image displaying the neck with indicators of a "right stretch".
12+
- `Neck_Side_Stretch.png`: Image displaying the neck with indicators of a stretch of both sides of the neck.
13+
14+
## Model
15+
### Stretch Colors
16+
This file stores all colors used within the stretch app to assure easy exchangeability and consistency within this app.
17+
18+
### Stretch State
19+
This file stores all classes used to store stretching information, such as
20+
- `NeckStretchState`: Stores all data concerning a stretching state and it's asset paths
21+
- `StretchStats`: Stores all data concering the most recent stretching session
22+
- `StretchSettings`: Stores all data needed to configure a stretching session
23+
- `NeckStretch`: Provides a one class solution which compromises all of the Model Data into this Class. It provides all functions needed to get and modify the data and also has all the code concerning the stretch state switches.
24+
25+
## View
26+
27+
### App View
28+
This file consiststs of the module used to display all the submodules of this app and is built up just like the normal app selector in the open-earable app itself. Notable is that this is a stateful widget which initializes the final `StretchViewModel` object which is used to store and manage all data needed for this app.
29+
30+
### Stretch Arc Painter
31+
This is a modified version of the `arc_painter` used in the `posture_tracker` app, which draws the right indicators with the right colors from the `stretch_colors.dart` to indicate whether the user is currently stretching in the right direction and to display what area is desireable or undesireable for the current stretch.
32+
33+
### Stretch Roll View
34+
This is a modified version of the `roll_view` used in the `posture_tracker` app, which is used to draw the whole "head area" of a tracking session. This file is edited to support the different neck stretch types and draw the arcs according to them.
35+
36+
### Stretch Settings View
37+
This is the view used to display the settings module and edit all the settings for a neck stretching session. It uses the `TextEditingController` to parse any input by the user, which is then used to set the right settings in the `StretchViewModel` for a stretching exercise.
38+
39+
### Stretch Stats View
40+
This is the view used to display the stats of the most recent stretching exercise. These stats are stored and editied by the `StretchViewModel`.
41+
42+
### Stretch Tracker View
43+
This module is the view of the stretch tracker module. Here you can start stretching and can track your stretching progess via the UI. The UI is drawn using an modified version of the `posture arc_painter.dart`, the `stretch_arc_painter.dart`. This view also provides certain functions to easily draw the head tracker view in other modules.
44+
45+
### Stretch Tutorial View
46+
This is the view for the stretch tutorial module, which is used to show the user how to use this app, and has an embedded youtube video (using an [youtube player package](https://pub.dev/packages/youtube_player_flutter)), which shows all of the neck stretches used by this app.
47+
48+
## View Model
49+
### Stretch View Model
50+
This file stores the `StretchViewModel`, which stores all data used by this app and is used to change it on the fly by the submodules. It also provides the functionality to track the stats of the user for the Stretch Stats View. Furthermore it is used to stop and start the tracking by the earable.
51+
52+
---
53+
By Soheel Dario Aghadavoodi Jolfaei - [GitHub](https://github.com/BasicallyPolaris/oe-app)

open_earable/lib/apps/neck_stretch/model/stretch_colors.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:flutter/material.dart';
22

33
/// Colors used for the arcs around the head
4-
final Color outerRing = Color.fromARGB(255, 195, 195, 195);
4+
final Color rightAreaIndicator = Color.fromARGB(255, 195, 195, 195);
55
final Color wrongAreaIndicator = Color(0xFF7A7A7A);
66

77
/// Colors used for bad stretch directions
@@ -19,4 +19,4 @@ final Color stretchedAreaColor = Color.fromARGB(255, 0, 186, 255);
1919
/// Colors used for the stretching button
2020
final Color startButtonColor = Color(0xff77F2A1);
2121
final Color stopButtonColor = Color(0xfff27777);
22-
final Color restingButtonColor = Color(0xffffbb3d);
22+
final Color restingButtonColor = Color(0xffffbb3d);

open_earable/lib/apps/neck_stretch/view/stretch_arc_painter.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class StretchArcPainter extends CustomPainter {
2121
@override
2222
void paint(Canvas canvas, Size size) {
2323
Paint circlePaint = Paint()
24-
..color = outerRing
24+
..color = rightAreaIndicator
2525
..style = PaintingStyle.stroke
2626
..strokeWidth = 5.0;
2727

@@ -209,4 +209,4 @@ class StretchArcPainter extends CustomPainter {
209209
// check if oldDelegate is an ArcPainter and if the angle is the same
210210
return oldDelegate is ArcPainter && oldDelegate.angle != this.angle;
211211
}
212-
}
212+
}

open_earable/lib/apps/neck_stretch/view/stretch_tutorial_view.dart

+16-3
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class _StretchTutorialViewState extends State<StretchTutorialView> {
9494
],
9595
),
9696
),
97+
9798
/// Card used to explain the tracking colors
9899
Card(
99100
color: Theme.of(context).colorScheme.primary,
@@ -102,7 +103,6 @@ class _StretchTutorialViewState extends State<StretchTutorialView> {
102103
ListTile(
103104
title: Text("Explaining the Tracking Colors"),
104105
),
105-
106106
Padding(
107107
padding: EdgeInsets.fromLTRB(16, 0, 16, 0),
108108
child: RichText(
@@ -117,7 +117,6 @@ class _StretchTutorialViewState extends State<StretchTutorialView> {
117117
),
118118
),
119119
),
120-
121120
Padding(
122121
padding: EdgeInsets.fromLTRB(24, 0, 24, 0),
123122
child: RichText(
@@ -145,7 +144,19 @@ class _StretchTutorialViewState extends State<StretchTutorialView> {
145144
),
146145
TextSpan(
147146
text:
148-
'You are currently stretching, try to gently move your head into the grey area\n\n',
147+
'You are currently stretching, try to gently move your head into the ',
148+
),
149+
TextSpan(
150+
text: 'light grey ',
151+
style: TextStyle(
152+
fontWeight: FontWeight.bold,
153+
fontSize: 15,
154+
color: rightAreaIndicator,
155+
),
156+
),
157+
TextSpan(
158+
text:
159+
'area\n\n',
149160
),
150161
],
151162
),
@@ -154,6 +165,7 @@ class _StretchTutorialViewState extends State<StretchTutorialView> {
154165
],
155166
),
156167
),
168+
157169
/// Example of the Tracker in Main Neck Stretch state
158170
Card(
159171
color: Theme.of(context).colorScheme.primary,
@@ -240,6 +252,7 @@ class _StretchTutorialViewState extends State<StretchTutorialView> {
240252
],
241253
),
242254
),
255+
243256
/// Card explaining the stretching button
244257
Card(
245258
color: Theme.of(context).colorScheme.primary,

0 commit comments

Comments
 (0)