package seedu.address.ui;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import seedu.address.model.task.ReadOnlyTask;

public class TaskCard extends UiPart<Region> {

    private static final String FXML = "TaskListCard.fxml";

    @FXML
    private HBox cardPane;
    @FXML
    private Label name;
    @FXML
    private Label id;
    @FXML
    private Label deadline;
    @FXML
    private Label description;
    @FXML
    private Label identificationnumber;
    @FXML
    private FlowPane tags;

    public TaskCard(ReadOnlyTask task, int displayedIndex) {
        super(FXML);
        name.setText(task.getName().name);
        id.setText(displayedIndex + ". ");
        deadline.setText(task.getDeadline().date.toString());
        description.setText(task.getDescription().description);
        identificationnumber.setText(task.getID().value.toString());
        initTags(task);
    }

    private void initTags(ReadOnlyTask task) {
        task.getTags().forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
    }
}

@@ -729,20 +729,26 @@
 tName().
-name
+toString()
 );%0A     
@@ -833,13 +833,8 @@
 e().
-date.
 toSt
@@ -892,27 +892,26 @@
 ption().
-description
+toString()
 );%0A     
@@ -959,14 +959,8 @@
 D().
-value.
 toSt

Fix object access in TaskCard