Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
3 Schweinehunde
Encrateia
Commits
5048ceaf
Commit
5048ceaf
authored
May 06, 2020
by
Administrator
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
templates for zone schemas available, when a zone exists; Dillinger heart rate zone schema
parent
810ceefd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
118 additions
and
34 deletions
+118
-34
lib/models/heart_rate_zone_schema.dart
lib/models/heart_rate_zone_schema.dart
+47
-0
lib/widgets/athlete_widgets/athlete_heart_rate_zone_schema_widget.dart
...thlete_widgets/athlete_heart_rate_zone_schema_widget.dart
+41
-16
lib/widgets/athlete_widgets/athlete_power_zone_schema_widget.dart
...ets/athlete_widgets/athlete_power_zone_schema_widget.dart
+30
-18
No files found.
lib/models/heart_rate_zone_schema.dart
View file @
5048ceaf
...
...
@@ -25,6 +25,14 @@ class HeartRateZoneSchema extends ChangeNotifier {
..
base
=
180
;
}
HeartRateZoneSchema
.
likeStefanDillinger
({
Athlete
athlete
})
{
db
=
DbHeartRateZoneSchema
()
..
athletesId
=
athlete
.
db
.
id
..
name
=
"like Stefan Dillinger"
..
date
=
DateTime
(
1970
,
01
,
01
)
..
base
=
165
;
}
addGarminZones
()
async
{
await
HeartRateZone
(
heartRateZoneSchema:
this
,
...
...
@@ -63,6 +71,45 @@ class HeartRateZoneSchema extends ChangeNotifier {
).
db
.
save
();
}
addStefanDillingerZones
()
async
{
await
HeartRateZone
(
heartRateZoneSchema:
this
,
name:
"Z1"
,
lowerPercentage:
70
,
upperPercentage:
80
,
color:
Colors
.
grey
.
value
,
).
db
.
save
();
await
HeartRateZone
(
heartRateZoneSchema:
this
,
name:
"Z2"
,
lowerPercentage:
80
,
upperPercentage:
88
,
color:
Colors
.
blue
.
value
,
).
db
.
save
();
await
HeartRateZone
(
heartRateZoneSchema:
this
,
name:
"Z3"
,
lowerPercentage:
88
,
upperPercentage:
95
,
color:
Colors
.
green
.
value
,
).
db
.
save
();
await
HeartRateZone
(
heartRateZoneSchema:
this
,
name:
"Z4"
,
lowerPercentage:
95
,
upperPercentage:
100
,
color:
Colors
.
orange
.
value
,
).
db
.
save
();
await
HeartRateZone
(
heartRateZoneSchema:
this
,
name:
"Z5/6"
,
lowerPercentage:
100
,
upperPercentage:
115
,
color:
Colors
.
red
.
value
,
).
db
.
save
();
}
String
toString
()
=>
'
$db
.date
$db
.name'
;
delete
()
async
{
...
...
lib/widgets/athlete_widgets/athlete_heart_rate_zone_schema_widget.dart
View file @
5048ceaf
...
...
@@ -32,13 +32,14 @@ class _AthleteHeartRateZoneSchemaWidgetState
Widget
build
(
context
)
{
if
(
heartRateZoneSchemas
!=
null
)
{
if
(
heartRateZoneSchemas
.
length
>
0
)
{
rows
=
(
heartRateZoneSchemas
.
length
<
8
)
?
heartRateZoneSchemas
.
length
:
8
;
rows
=
(
heartRateZoneSchemas
.
length
<
8
)
?
heartRateZoneSchemas
.
length
:
8
;
return
ListView
(
children:
<
Widget
>[
Center
(
child:
Text
(
"
\n
Heart Rate Zone Schemas
${offset + 1}
-
${offset + rows}
"
"of
${heartRateZoneSchemas.length}
"
,
"of
${heartRateZoneSchemas.length}
"
,
style:
Theme
.
of
(
context
).
textTheme
.
title
,
),
),
...
...
@@ -95,7 +96,7 @@ class _AthleteHeartRateZoneSchemaWidgetState
MaterialPageRoute
(
builder:
(
context
)
=>
AddHeartRateZoneSchemaScreen
(
heartRateZoneSchema:
HeartRateZoneSchema
(
athlete:
widget
.
athlete
),
HeartRateZoneSchema
(
athlete:
widget
.
athlete
),
),
),
);
...
...
@@ -107,8 +108,8 @@ class _AthleteHeartRateZoneSchemaWidgetState
onPressed:
(
offset
==
0
)
?
null
:
()
=>
setState
(()
{
offset
>
8
?
offset
=
offset
-
rows
:
offset
=
0
;
}),
offset
>
8
?
offset
=
offset
-
rows
:
offset
=
0
;
}),
),
Spacer
(),
MyButton
.
navigate
(
...
...
@@ -116,14 +117,15 @@ class _AthleteHeartRateZoneSchemaWidgetState
onPressed:
(
offset
+
rows
==
heartRateZoneSchemas
.
length
)
?
null
:
()
=>
setState
(()
{
offset
+
rows
<
heartRateZoneSchemas
.
length
-
rows
?
offset
=
offset
+
rows
:
offset
=
heartRateZoneSchemas
.
length
-
rows
;
}),
offset
+
rows
<
heartRateZoneSchemas
.
length
-
rows
?
offset
=
offset
+
rows
:
offset
=
heartRateZoneSchemas
.
length
-
rows
;
}),
),
Spacer
(),
],
),
templateButtons
(),
],
);
}
else
{
...
...
@@ -149,19 +151,14 @@ You could also create a schema from scratch.
MaterialPageRoute
(
builder:
(
context
)
=>
AddHeartRateZoneSchemaScreen
(
heartRateZoneSchema:
HeartRateZoneSchema
(
athlete:
widget
.
athlete
),
HeartRateZoneSchema
(
athlete:
widget
.
athlete
),
),
),
);
getData
();
},
),
RaisedButton
(
// MyIcon.downloadLocal,
color:
Colors
.
orange
,
child:
Text
(
"Zone schema like Garmin"
),
onPressed:
()
=>
likeGarmin
(),
),
templateButtons
(),
],
),
);
...
...
@@ -184,4 +181,32 @@ You could also create a schema from scratch.
await
heartRateZoneSchema
.
addGarminZones
();
await
getData
();
}
likeStefanDillinger
()
async
{
Athlete
athlete
=
widget
.
athlete
;
var
heartRateZoneSchema
=
HeartRateZoneSchema
.
likeStefanDillinger
(
athlete:
athlete
);
await
heartRateZoneSchema
.
db
.
save
();
await
heartRateZoneSchema
.
addStefanDillingerZones
();
await
getData
();
}
templateButtons
()
{
return
Column
(
children:
[
Divider
(),
Text
(
"Add heart rate zone schema from template:"
),
RaisedButton
(
// MyIcon.downloadLocal,
color:
Colors
.
orange
,
child:
Text
(
"like Garmin"
),
onPressed:
()
=>
likeGarmin
(),
),
RaisedButton
(
// MyIcon.downloadLocal,
color:
Colors
.
orange
,
child:
Text
(
"like Stefan Dillinger"
),
onPressed:
()
=>
likeStefanDillinger
(),
),
]);
}
}
lib/widgets/athlete_widgets/athlete_power_zone_schema_widget.dart
View file @
5048ceaf
...
...
@@ -124,6 +124,10 @@ class _AthletePowerZoneSchemaWidgetState
Spacer
(),
],
),
Padding
(
padding:
EdgeInsets
.
all
(
25.0
),
child:
templateButtons
(),
)
],
);
}
else
{
...
...
@@ -156,24 +160,7 @@ You could also create a schema from scratch.
getData
();
},
),
RaisedButton
(
// MyIcon.downloadLocal,
color:
Colors
.
orange
,
child:
Text
(
"Zone schema like Stryd"
),
onPressed:
()
=>
likeStryd
(),
),
RaisedButton
(
// MyIcon.downloadLocal,
color:
Colors
.
orange
,
child:
Text
(
"Zone schema like Jim Vance"
),
onPressed:
()
=>
likeJimVance
(),
),
RaisedButton
(
// MyIcon.downloadLocal,
color:
Colors
.
orange
,
child:
Text
(
"Zone schema like Stefan Dillinger"
),
onPressed:
()
=>
likeStefanDillinger
(),
),
templateButtons
(),
],
),
);
...
...
@@ -212,4 +199,29 @@ You could also create a schema from scratch.
await
powerZoneSchema
.
addStefanDillingerZones
();
await
getData
();
}
templateButtons
()
{
return
Column
(
children:
[
Divider
(),
Text
(
"Add power zone schema from template:"
),
RaisedButton
(
// MyIcon.downloadLocal,
color:
Colors
.
orange
,
child:
Text
(
"like Stryd"
),
onPressed:
()
=>
likeStryd
(),
),
RaisedButton
(
// MyIcon.downloadLocal,
color:
Colors
.
orange
,
child:
Text
(
"like Jim Vance"
),
onPressed:
()
=>
likeJimVance
(),
),
RaisedButton
(
// MyIcon.downloadLocal,
color:
Colors
.
orange
,
child:
Text
(
"like Stefan Dillinger"
),
onPressed:
()
=>
likeStefanDillinger
(),
),
]);
}
}
Stefan Haslinger
@informatom
mentioned in issue
#26 (closed)
·
May 06, 2020
mentioned in issue
#26 (closed)
mentioned in issue #26
Toggle commit list
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