AI-generated Key Takeaways
-
CardBuilder is used to build Card objects.
-
You can add card actions and sections to a Card using the builder.
-
The build() method finalizes and validates the Card object.
-
Various methods allow setting the card's display style, footer, header, name, and peek card header.
A builder for Card
objects.
Methods
| Method | Return type | Brief description |
|---|---|---|
Card
|
Adds a Card
to this Card. |
|
Card
|
Adds a section to this card. | |
Card
|
Builds the current card and validates it. | |
Card
|
Sets the display style for this card. | |
Card
|
Sets a fixed footer for this card. | |
Card
|
Sets the header for this card. | |
Card
|
Sets the name for this card. | |
Card
|
Sets the peek card header. |
Detailed documentation
add
Card
Action(cardAction)
Adds a Card
to this Card.
Parameters
| Name | Type | Description |
|---|---|---|
card
|
Card
|
The Card
to use. |
Return
Card
— This object, for chaining.
add
Section(section)
Adds a section to this card. You can't add more than 100 sections to a card.
Parameters
| Name | Type | Description |
|---|---|---|
section
|
Card
|
The Card
to use. |
Return
Card
— This object, for chaining.
build()
set
Display
Style(displayStyle)
Sets the display style for this card.
If the display style is set to Display
, the card is shown by replacing
the view of top card in the card stack.
If the display style is set to Display
, the header of the card appears at
the bottom of the sidebar, partially covering the current top card of the stack. Clicking the
header pops the card into the card stack. If the card has no header, a generated header is used
instead.
Display
only works for card returned from contextual trigger function.
Parameters
| Name | Type | Description |
|---|---|---|
display
|
Display
|
The Display
to set. |
Return
Card
— This object, for chaining.
set
Header(cardHeader)
Sets the header for this card.
Parameters
| Name | Type | Description |
|---|---|---|
card
|
Card
|
The Card
to use. |
Return
Card
— This object, for chaining.
set
Name(name)
Sets the name for this card. The name can be used for navigation .
Parameters
| Name | Type | Description |
|---|---|---|
name
|
String
|
The name. |
Return
Card
— This object, for chaining.
set
Peek
Card
Header(peekCardHeader)
Sets the peek card header.
The peek card is set on the first card returned from a contextual trigger function. It is used as a descriptive placeholder widget so that users can navigate from a homepage stack to the contextual stack.
Parameters
| Name | Type | Description |
|---|---|---|
peek
|
Card
|
The Card
to set. |
Return
Card
— This object, for chaining.

