From c93e92c3028ab5278edb8ea1a68c1fc3359cdb39 Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Tue, 2 Aug 2022 18:25:12 -0500 Subject: [PATCH] done tasks are not marked past due, minor formatting changes --- lib/components/BucketTaskCard.dart | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/components/BucketTaskCard.dart b/lib/components/BucketTaskCard.dart index 6639857..55e65e5 100644 --- a/lib/components/BucketTaskCard.dart +++ b/lib/components/BucketTaskCard.dart @@ -99,8 +99,9 @@ class _BucketTaskCardState extends State with AutomaticKeepAlive ), ], ); - final duration = widget.task.dueDate.difference(DateTime.now()); if (widget.task.dueDate.year > 2) { + final duration = widget.task.dueDate.difference(DateTime.now()); + final pastDue = duration.isNegative && !widget.task.done; titleRow.children.add(Container( constraints: chipConstraints, padding: EdgeInsets.only(left: 4), @@ -108,13 +109,13 @@ class _BucketTaskCardState extends State with AutomaticKeepAlive child: Chip( avatar: Icon( Icons.calendar_month, - color: duration.isNegative ? Colors.red : null, + color: pastDue ? Colors.red : null, ), label: Text(durationToHumanReadable(duration)), labelStyle: theme.textTheme.labelLarge.copyWith( - color: duration.isNegative ? Colors.red : null, + color: pastDue ? Colors.red : null, ), - backgroundColor: duration.isNegative ? Colors.red.withAlpha(20) : null, + backgroundColor: pastDue ? Colors.red.withAlpha(20) : null, ), ), )); @@ -190,15 +191,14 @@ class _BucketTaskCardState extends State with AutomaticKeepAlive constraints: rowConstraints, child: identifierRow, ), - Container( - constraints: rowConstraints, - child: titleRow, - ), Padding( - padding: labelRow.children.isNotEmpty - ? const EdgeInsets.only(top: 8) : EdgeInsets.zero, - child: labelRow, + padding: EdgeInsets.only(top: 4, bottom: labelRow.children.isNotEmpty ? 8 : 0), + child: Container( + constraints: rowConstraints, + child: titleRow, + ), ), + labelRow, ], ), ),