GoogleAppsCardV1Card class

A card interface displayed in a Google Chat message or Google Workspace add-on.

Cards support a defined layout, interactive UI elements like buttons, and rich media like images. Use cards to present detailed information, gather information from users, and guide users to take a next step. Card builder To learn how to build cards, see the following documentation: * For Google Chat apps, see Design the components of a card or dialog.

  • For Google Workspace add-ons, see [Card-based interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards). Note: You can add up to 100 widgets per card. Any widgets beyond this limit are ignored. This limit applies to both card messages and dialogs in Google Chat apps, and to cards in Google Workspace add-ons. Example: Card message for a Google Chat app Example contact card To create the sample card message in Google Chat, use the following JSON:
"title": "Sasha", "subtitle": "Software Engineer", "imageUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
"imageType": "CIRCLE", "imageAltText": "Avatar for Sasha" }, "sections": [ {
"header": "Contact Info", "collapsible": true, "uncollapsibleWidgetsCount":
1, "widgets": [ { "decoratedText": { "startIcon": { "knownIcon": "EMAIL" },
"text": "sasha@example.com" } }, { "decoratedText": { "startIcon": {
"knownIcon": "PERSON" }, "text": "Online" } }, { "decoratedText": {
"startIcon": { "knownIcon": "PHONE" }, "text": "+1 (555) 555-1234" } }, {
"buttonList": { "buttons": [ { "text": "Share", "onClick": { "openLink": {
"url": "https://example.com/share" } } }, { "text": "Edit", "onClick": {
"action": { "function": "goToView", "parameters": [ { "key": "viewType",
"value": "EDIT" } ] } } } ] } } ] } ] } } ] } ```

Constructors

GoogleAppsCardV1Card.new({List<GoogleAppsCardV1CardAction>? cardActions, String? displayStyle, GoogleAppsCardV1CardFixedFooter? fixedFooter, GoogleAppsCardV1CardHeader? header, String? name, GoogleAppsCardV1CardHeader? peekCardHeader, String? sectionDividerStyle, List<GoogleAppsCardV1Section>? sections})
GoogleAppsCardV1Card.fromJson(Map json_)

Properties

cardActions List<GoogleAppsCardV1CardAction>?
The card's actions.
getter/setter pair
displayStyle String?
In Google Workspace add-ons, sets the display properties of the peekCardHeader.
getter/setter pair
fixedFooter GoogleAppsCardV1CardFixedFooter?
The fixed footer shown at the bottom of this card.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
The header of the card.
getter/setter pair
name String?
Name of the card.
getter/setter pair
peekCardHeader GoogleAppsCardV1CardHeader?
When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sectionDividerStyle String?
The divider style between the header, sections and footer. Possible string values are:
getter/setter pair
sections List<GoogleAppsCardV1Section>?
Contains a collection of widgets.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited