1
0
mirror of https://github.com/go-vikunja/app synced 2024-06-02 18:49:47 +00:00

use identifier instead of id for card display

This commit is contained in:
Paul Nettleton 2022-08-02 11:59:03 -05:00
parent e56403a6b5
commit e00be1f8b1
2 changed files with 11 additions and 6 deletions

View File

@ -58,10 +58,11 @@ class _BucketTaskCardState extends State<BucketTaskCard> with AutomaticKeepAlive
const chipConstraints = BoxConstraints(maxHeight: chipHeight);
final theme = Theme.of(context);
final numRow = Row(
final identifierRow = Row(
children: <Widget>[
Text(
'#${widget.task.id}',
widget.task.identifier.isNotEmpty
? '#${widget.task.identifier.substring(1)}' : '${widget.task.id}',
style: theme.textTheme.subtitle2.copyWith(
color: Colors.grey,
),
@ -69,7 +70,7 @@ class _BucketTaskCardState extends State<BucketTaskCard> with AutomaticKeepAlive
],
);
if (widget.task.done) {
numRow.children.insert(0, Container(
identifierRow.children.insert(0, Container(
constraints: chipConstraints,
padding: EdgeInsets.only(right: 4),
child: FittedBox(
@ -187,7 +188,7 @@ class _BucketTaskCardState extends State<BucketTaskCard> with AutomaticKeepAlive
children: <Widget>[
Container(
constraints: rowConstraints,
child: numRow,
child: identifierRow,
),
Container(
constraints: rowConstraints,

View File

@ -11,7 +11,7 @@ class Task {
int id, parentTaskId, priority, listId, bucketId;
DateTime created, updated, dueDate, startDate, endDate;
List<DateTime> reminderDates;
String title, description;
String title, description, identifier;
bool done;
Color color;
double kanbanPosition;
@ -27,6 +27,7 @@ class Task {
{@required this.id,
this.title,
this.description,
this.identifier,
this.done = false,
this.reminderDates,
this.dueDate,
@ -50,6 +51,7 @@ class Task {
: id = json['id'],
title = json['title'],
description = json['description'],
identifier = json['identifier'],
done = json['done'],
reminderDates = (json['reminder_dates'] as List<dynamic>)
?.map((ts) => DateTime.parse(ts))
@ -91,6 +93,7 @@ class Task {
'id': id,
'title': title,
'description': description,
'identifier': identifier,
'done': done ?? false,
'reminder_dates':
reminderDates?.map((date) => date?.toUtc()?.toIso8601String())?.toList(),
@ -118,7 +121,7 @@ class Task {
int id, int parentTaskId, int priority, int listId, int bucketId,
DateTime created, DateTime updated, DateTime dueDate, DateTime startDate, DateTime endDate,
List<DateTime> reminderDates,
String title, String description,
String title, String description, String identifier,
bool done,
Color color,
bool resetColor,
@ -143,6 +146,7 @@ class Task {
reminderDates: reminderDates ?? this.reminderDates,
title: title ?? this.title,
description: description ?? this.description,
identifier: identifier ?? this.identifier,
done: done ?? this.done,
color: (resetColor ?? false) ? null : (color ?? this.color),
kanbanPosition: kanbanPosition ?? this.kanbanPosition,