Create the Task model
In this task, you will create the Task model which we will use across the application and associate it with the Local State to store them in the device.
Last updated
In this task, you will create the Task model which we will use across the application and associate it with the Local State to store them in the device.
Last updated
Navigate to the API tab.
Click on the Model tab in the left panel.
Click on the Add API Model button.
Fill the Model Name with "Task".
To add some Properties by clicking on the Add Field button below Properties :
To change a Type click on the showing one and select it in the dropdown. You can choose as well if the property is Nullable and/or is a List.
Add a "title" of type String.
Add a "date" of type DateTime.
Add a "description" of type String?.
Add a "isDone" of type bool.
Add a "priority" of type int?.
Add a "comments" of type List<String>.
Click on Save.
If you click on the Task model you should have the same as shown below.
The Task model created now we have to create a Local State variable to store the tasks in the device storage.
Navigate to the State tab.
Click on the Add Local State button.
Fill the Field Name with "taskList".
Enable the Persisted switch to allow the application to store the Tasks in the device.
Select Task as Field Type in the bottom of the dropdown, in the Custom type section.
Click on List.
Click on Save.
In the next step we will see how to initialize a page with an observable, set the values, create and update the layout in consequence.