diff --git a/CHANGELOG.md b/CHANGELOG.md index b221b18..e8be671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/app/lib/widget/linechart.dart b/app/lib/widget/linechart.dart index 4ddec1e..19df9e7 100644 --- a/app/lib/widget/linechart.dart +++ b/app/lib/widget/linechart.dart @@ -230,16 +230,20 @@ class _CustomLineChartState extends State { horizontalLines: [ if (targetWeight != null) HorizontalLine( - y: targetWeight, + y: targetWeight / unitScaling, color: Theme.of(context).colorScheme.tertiary, strokeWidth: 2, dashArray: [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,