Skip to content

Commit

Permalink
Merge pull request #112 from QuantumPhysique/improveTargetWeightLabel
Browse files Browse the repository at this point in the history
Improve readability and bugs of target weight label.
  • Loading branch information
braniii committed Jul 3, 2024
2 parents b17f868 + 3edda52 commit 61b2a25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Other changes:
- Upgraded dependencies
- Improve readability of target weight label

### Bugfix 🐛:
- Fix broken color of linechart
- Allow adding measurements older than 2 years
- Fix bug of showing target weight correctly using st/lb
- Fixed a bug where saving an unmodified measurement resulted in it being deleted


Expand Down
8 changes: 6 additions & 2 deletions app/lib/widget/linechart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,20 @@ class _CustomLineChartState extends State<CustomLineChart> {
horizontalLines: <HorizontalLine>[
if (targetWeight != null)
HorizontalLine(
y: targetWeight,
y: targetWeight / unitScaling,
color: Theme.of(context).colorScheme.tertiary,
strokeWidth: 2,
dashArray: <int>[8, 6],
label: HorizontalLineLabel(
show: true,
alignment: Alignment.topRight,
alignment:
ip.db.sortedMeasurements.first.measurement.weight > targetWeight
? Alignment.bottomRight
: Alignment.topRight,
padding: const EdgeInsets.only(bottom: 3),
style: Theme.of(context).textTheme.bodySmall!.apply(
color: Theme.of(context).colorScheme.onSurface,
backgroundColor: Theme.of(context).colorScheme.surfaceContainerLow,
),
labelResolver: (HorizontalLine line) =>
AppLocalizations.of(context)!.targetWeightShort,
Expand Down

0 comments on commit 61b2a25

Please sign in to comment.