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 dynamic, interactive, and consistent UIs with cards.
- For Google Workspace Add-ons, see [Card-based interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards). Example: Card message for a Google Chat app To create the sample card message in Google Chat, use the following JSON:
"title": "Sasha", "subtitle": "Software Engineer", "imageUrl":
"https://developers.google.com/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({List<
GoogleAppsCardV1CardAction> ? cardActions, String? displayStyle, 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 -
The fixed footer shown at the bottom of this card.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- header ↔ GoogleAppsCardV1CardHeader?
-
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 sections.
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