mirror of
https://github.com/go-vikunja/app
synced 2024-06-01 02:06:51 +00:00
moved due date check to task.dart
This commit is contained in:
parent
e73daab38e
commit
b697944a6e
|
@ -99,7 +99,7 @@ class _BucketTaskCardState extends State<BucketTaskCard> with AutomaticKeepAlive
|
|||
),
|
||||
],
|
||||
);
|
||||
if (widget.task.dueDate.year > 2) {
|
||||
if (widget.task.hasDueDate) {
|
||||
final duration = widget.task.dueDate.difference(DateTime.now());
|
||||
final pastDue = duration.isNegative && !widget.task.done;
|
||||
titleRow.children.add(Container(
|
||||
|
|
|
@ -77,7 +77,7 @@ class TaskTileState extends State<TaskTile> with AutomaticKeepAliveClientMixin {
|
|||
) : Text(_currentTask.title),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
value: _currentTask.done ?? false,
|
||||
subtitle: widget.showInfo && _currentTask.dueDate.year > 2 ?
|
||||
subtitle: widget.showInfo && _currentTask.hasDueDate ?
|
||||
Text("Due " + durationToHumanReadable(durationUntilDue), style: TextStyle(color: durationUntilDue.isNegative ? Colors.red : null),)
|
||||
: _currentTask.description == null || _currentTask.description.isEmpty
|
||||
? null
|
||||
|
|
|
@ -141,6 +141,8 @@ class Task {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool get hasDueDate => dueDate.year != 1;
|
||||
|
||||
Task copyWith({
|
||||
int id, int parentTaskId, int priority, int listId, int bucketId,
|
||||
DateTime created, DateTime updated, DateTime dueDate, DateTime startDate, DateTime endDate,
|
||||
|
|
Loading…
Reference in New Issue
Block a user