Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
3 Schweinehunde
Encrateia
Commits
0da2f8b3
Commit
0da2f8b3
authored
May 13, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
instruction on updating current base values
parent
508f711a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
8 deletions
+35
-8
lib/screens/add_heart_rate_zone_schema_screen.dart
lib/screens/add_heart_rate_zone_schema_screen.dart
+22
-8
lib/screens/add_power_zone_schema_screen.dart
lib/screens/add_power_zone_schema_screen.dart
+12
-0
lib/utils/icon_utils.dart
lib/utils/icon_utils.dart
+1
-0
No files found.
lib/screens/add_heart_rate_zone_schema_screen.dart
View file @
0da2f8b3
...
...
@@ -21,7 +21,8 @@ class AddHeartRateZoneSchemaScreen extends StatefulWidget {
_AddHeartRateZoneSchemaScreenState
();
}
class
_AddHeartRateZoneSchemaScreenState
extends
State
<
AddHeartRateZoneSchemaScreen
>
{
class
_AddHeartRateZoneSchemaScreenState
extends
State
<
AddHeartRateZoneSchemaScreen
>
{
List
<
HeartRateZone
>
heartRateZones
=
[];
int
offset
=
0
;
int
rows
;
...
...
@@ -42,6 +43,18 @@ class _AddHeartRateZoneSchemaScreenState extends State<AddHeartRateZoneSchemaScr
body:
ListView
(
padding:
EdgeInsets
.
only
(
left:
20
,
right:
20
),
children:
<
Widget
>[
Card
(
margin:
EdgeInsets
.
all
(
40
),
child:
ListTile
(
leading:
MyIcon
.
warning
,
title:
Text
(
"Instructions to update your current base value"
),
subtitle:
Text
(
"1) Change the VALID FROM date to today to copy the heart rate zone schema.
\n
"
"2) Edit the BASE VALUE to the new value.
\n
"
"3) Click SAVE to persist your changes."
,
),
),
),
DateTimeField
(
decoration:
InputDecoration
(
labelText:
"Valid from"
,
...
...
@@ -70,7 +83,8 @@ class _AddHeartRateZoneSchemaScreenState extends State<AddHeartRateZoneSchemaScr
),
initialValue:
widget
.
heartRateZoneSchema
.
db
.
base
.
toString
(),
keyboardType:
TextInputType
.
number
,
onChanged:
(
value
)
=>
updateHeartRateZoneBase
(
base:
int
.
parse
(
value
)),
onChanged:
(
value
)
=>
updateHeartRateZoneBase
(
base:
int
.
parse
(
value
)),
),
SizedBox
(
height:
10
),
DataTable
(
...
...
@@ -127,8 +141,8 @@ class _AddHeartRateZoneSchemaScreenState extends State<AddHeartRateZoneSchemaScr
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AddHeartRateZoneScreen
(
heartRateZone:
HeartRateZone
(
heartRateZoneSchema:
widget
.
heartRateZoneSchema
),
heartRateZone:
HeartRateZone
(
heartRateZoneSchema:
widget
.
heartRateZoneSchema
),
base:
widget
.
heartRateZoneSchema
.
db
.
base
,
),
),
...
...
@@ -160,8 +174,8 @@ class _AddHeartRateZoneSchemaScreenState extends State<AddHeartRateZoneSchemaScr
saveHeartRateZoneSchema
(
BuildContext
context
)
async
{
await
widget
.
heartRateZoneSchema
.
db
.
save
();
await
DbHeartRateZone
()
.
upsertAll
(
heartRateZones
.
map
((
heartRateZone
)
=>
heartRateZone
.
db
).
toList
());
await
DbHeartRateZone
()
.
upsertAll
(
heartRateZones
.
map
((
heartRateZone
)
=>
heartRateZone
.
db
).
toList
());
Navigator
.
of
(
context
).
pop
();
}
...
...
@@ -197,8 +211,8 @@ class _AddHeartRateZoneSchemaScreenState extends State<AddHeartRateZoneSchemaScr
..
heartRateZoneSchemataId
=
heartRateZoneSchemaId
..
id
=
null
;
}
await
DbHeartRateZone
()
.
upsertAll
(
heartRateZones
.
map
((
heartRateZone
)
=>
heartRateZone
.
db
).
toList
());
await
DbHeartRateZone
()
.
upsertAll
(
heartRateZones
.
map
((
heartRateZone
)
=>
heartRateZone
.
db
).
toList
());
await
getData
();
showDialog
(
context:
context
,
...
...
lib/screens/add_power_zone_schema_screen.dart
View file @
0da2f8b3
...
...
@@ -42,6 +42,18 @@ class _AddPowerZoneSchemaScreenState extends State<AddPowerZoneSchemaScreen> {
body:
ListView
(
padding:
EdgeInsets
.
only
(
left:
20
,
right:
20
),
children:
<
Widget
>[
Card
(
margin:
EdgeInsets
.
all
(
40
),
child:
ListTile
(
leading:
MyIcon
.
warning
,
title:
Text
(
"Instructions to update your current base value"
),
subtitle:
Text
(
"1) Change the VALID FROM date to today to copy the power zone schema.
\n
"
"2) Edit the BASE VALUE to the new value.
\n
"
"3) Click SAVE to persist your changes."
,
),
),
),
DateTimeField
(
decoration:
InputDecoration
(
labelText:
"Valid from"
,
...
...
lib/utils/icon_utils.dart
View file @
0da2f8b3
...
...
@@ -90,6 +90,7 @@ class MyIcon {
// V
static
final
verticalOscillation
=
Icon
(
Icons
.
unfold_more
);
// W
static
final
warning
=
Icon
(
Icons
.
warning
);
static
final
website
=
Icon
(
Icons
.
web
);
static
final
weight
=
Icon
(
Icons
.
restaurant_menu
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment