Teaser Widgets

Rendering Widgets

Two types of APIs are used to render widgets:

  • getInboxInsights - for inbox widget only
  • getInsights - for carousel, dashboardTracker, and hub widgets

Rendering Teasers

Teasers operate with a processed response from the server. The command can be called by the bank and either provided upon “startWidget” as payload, or requested by the widget if missing from the initialization.
Since “getInboxInsights” only retrieves insights and does not generate them, the solution requires a previous generation call.

Code Examples

Following are code examples, for carousel, trackersDashboard, hub, inbox, and manage-budgets. In each layout, the examples apply to all widget types, as defined under widgetType.

final personeticsInfo_carousel = {
  "protocolVersion": "2.6",
  "internationalization": {"language" “en”},
  "configurations": {
    "widgetType": “carousel”,
    "selectorString": "#root",
    "deviceType": “flutter”,
    "ctxid": “dashboard”,
		  "params": {},
  },
  'widgetHeight': 260,
  'widgetWidth': 320,
};

var personeticsInfo = Constants.personeticsInfo_carousel;
   BankPersoneticsDelegate bankPersoneticsDelegate = BankPersoneticsDelegate();
    var pDBWidgetController =
        widgetController(data, bankPersoneticsDelegate.doPersoneticsCommend);
    bankPersoneticsDelegate.pDBWidgetController = pDBWidgetController;

Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => pDBWidgetController,
      ),
    );
final personeticsInfo_carousel = {
  "protocolVersion": "2.6",
  "internationalization": {"language" “en”},
  "configurations": {
    "widgetType": “carousel”,
    "selectorString": "#root",
    "deviceType": “flutter”,
    "ctxid": “dashboard”,
		  "params": {},
  },
  'widgetHeight': 260,
  'widgetWidth': 320,
};

Note: the ‘selectorString’ example of ‘#root’ corresponds to the sample app example. The relevant path should be defined.

Payload Examples

{
  "configurations": {
    "deviceType": "web",
    "ctxId": "dashboard",
    "params": {
      "payload": {
        "GET_INSIGHTS": {
          "ok": true,
          "protocolVersion": "2.6",
          "requestChannel": "VANILLA_QA",
          "requestType": "getInsights",
          "requestId": "NLjFSETDjW7-K35x",
          "status": "200",
          "statusMessage": "ok",
          "insights": []],
          "numberOfInsights": 8,
          "unreadMessages": 4,
          "numberOfUnreadInsights": 4
        }
      },
      "userId": "B_1012"
    },
    "selectorString": "#root",
    "widgetType": "inbox"
  },
"assets": {
    "baseUrl": https://client-vanilla-assets.s3.amazonaws.com/product-react-assets/assets/,
    "useRemoteAssets": false
  },
  "internationalization": {
    "language": "en"
  },
}