Lists are important in a typical data handling application.
They are a primary way in which one locates a specific data item of interest.
In Logiak, data is represented in Objects and LISTING components is essentially the listing of Objects (instances) of a selected type.
In database terms, a listing shows the contents of a single database table.
By "List Item" we are referring to a row in the table.
Put another way: a list is a vertical array of List Items, each of which represents a different specific Object (instance). So if you have 30 patients in your database, your LISTING, unless you add a Filter, will contain 30 List Items.
List Item Configuration
So List Item Configuration concerns the following question: ok we are going to show the patients in a list, how do we want to represent each individual patient? What should each row in the list look like?
For this, we have a flexible "Widget Editor" with which you configure your own List Item "widget" which will be used to render each item in the list.
Object Fields in List Items
Given that we are always dealing with a list of objects of a certain type (patient in our example), the main part of list item configuration is specifying which fields of the object you want to show.
Choosing which fields to show
So in our example, we are showing a list of patient Objects (instances) and we have defined a patient object to have a name field and a date of birth field.
So let us initially configure a widget which shows name and date of birth.
How exactly should they be arranged together?
Arranging the fields
For example, do you want the name to be in a large font and the date of birth to be shown below in a smaller font and grey? Or do you want the name and the date of birth to be together horizontally, i.e. in a row?
Let us initially choose to include a Row widget and then put the name and date of birth fields in the Row.
So in the Widget editor dialogue, click the +Widget button, and navigate through the menus as shown, to add a Row container.
Arranging Object Fields in List Items
Once you have added the Row, you can select it and you will see, on the right, there are properties we can set which affect how the Row arranges its contents.
The widgets and their properties we are configuring here are mostly from the language Flutter and are documented there. So, for example, the possible values for the MainAxisAlignment property of the Row are documented here.
This looks like an attractive way to arrange the name field and the date of birth field:
(Flutter calls the contents of the row its "children").
So let us choose the spaceEvenly option for MainXAxisAlignment and leave the other properties to have default values.
Adding fields to Row
Now we can select the Row and add the two fields as "children", as shown here,
Be careful that you select the Row immediately before you add a Field, so that it is added as a child of the Row (and not, for example, as a child of the other Field)
After this, the configuration should look like this (below).
You can at any time edit the List Item configuration for a LISTING component by selecting the component and clicking the edit icon shown below.