The AddChildren
class is responsible for adding - at the beginning or in the end - or changing all views that inherit from Widget
and who accept children.
The addChildren structure is:
Attribute | Type | Required | Definition |
---|---|---|---|
componentId | String | ✓ | Defines the widget’s id, in which you want to add the views. |
value | List<ServerDrivenComponent> or Binding | ✓ | Defines the list of children you want to add. |
mode | Mode | Defines the placement of where the children will be inserted in the list or if the contents of the list will be replaced. By default the set mode is APPEND . |
It is an ENUM
, which values are:
Values | Definition |
---|---|
APPEND | Adds the view in the end of the children’s list. |
PREPEND | Adds the view on the beginning of the children’s list. |
REPLACE | Replaces all children of the widget. |
Container(
children = listOf(
Button("AddChildren", onPress = listOf(
addChildren(
componentId = "containerId",
value = listOf(
Text("New text added")
),
mode = Mode.APPEND
)
))
)
).apply { id = "containerId" }
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.