Skip to content

Commit

Permalink
#100 load bar iPhone8 Layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerolf Ziegenhain committed Jul 10, 2021
1 parent f2a69e9 commit b7a3567
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

- v0.59 - WIP Features (#87, #108, #109), Bugfixes (#111)
- v0.59 - WIP Features (#87, #108, #109), Bugfixes (#111, #100)
- v0.58 - Demonstrator with one working exercise. Progress bar (#103), bugfixes (#101).
- v0.57 - Bugfixes (#99, #104)
- v0.56 - Implemented 1 hand hold display (#96, #97), display next exercise intensity (#98).
Expand Down
44 changes: 37 additions & 7 deletions flutter_hangboard/lib/widgets/mqttView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class _MQTTViewState extends State<MQTTView> {
_buildIntensityPlot(currentAppState.getCurrentItensity,
currentAppState.getCurrentSetIntensity),
_buildControls(currentAppState.getAppConnectionState),
_buildLoadPlot(currentAppState.getLoadCurrentData),
//_buildLoadPlotDisplay(currentAppState.getLoadCurrent),
//_buildLoadPlot(currentAppState.getLoadCurrentData),
_buildLoadPlotDisplay(currentAppState.getLoadCurrent),
_buildLastExerciseStatistics(currentAppState.getLastHangTime,
currentAppState.getLastMaximalLoad),
],
Expand All @@ -100,10 +100,12 @@ class _MQTTViewState extends State<MQTTView> {
Widget _buildIntensityPlot(
double CurrentItensity, double CurrentSetIntensity) {
return (((CurrentSetIntensity < CurrentItensity) || (CurrentItensity > 1.0))
? Text("Current Intensity " +
CurrentItensity.toStringAsFixed(1) +
" and Exercise Int " +
CurrentSetIntensity.toStringAsFixed(1))
? Text(
"Current Intensity " +
CurrentItensity.toStringAsFixed(1) +
" and Exercise Int " +
CurrentSetIntensity.toStringAsFixed(1),
style: TextStyle(color: Colors.redAccent))
: LinearPercentIndicator(
//radius: 120.0,
//lineWidth: 13.0,
Expand Down Expand Up @@ -149,7 +151,35 @@ class _MQTTViewState extends State<MQTTView> {

// ignore: unused_element
Widget _buildLoadPlotDisplay(double LoadCurrent) {
return (Text("Current load: " + LoadCurrent.toString()));
double hangtime = 0.0;
double loadperc = LoadCurrent / 100;
if (loadperc < 0.0) {
loadperc = 0.0;
}
return (LinearPercentIndicator(
//radius: 120.0,
//lineWidth: 13.0,
//animation: true,
percent: loadperc,
center: new Text(
LoadCurrent.toStringAsFixed(2),
style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0),
),
//footer:
leading: new Text(
LoadCurrent.toStringAsFixed(0) + "kg",
style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 17.0),
),
trailing: new Text(
hangtime.toStringAsFixed(0) + "s",
style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 17.0),
),
//circularStrokeCap: CircularStrokeCap.round,
progressColor: Colors.redAccent,
)

//Text("Current load: " + LoadCurrent.toString())
);
}

Widget _buildLoadPlot(List<FlSpot> LoadCurrentData) {
Expand Down

0 comments on commit b7a3567

Please sign in to comment.