fromJson method

SDUIAction fromJson(
  1. Map<String, dynamic>? attributes
)

Implementation

SDUIAction fromJson(Map<String, dynamic>? attributes) {
  url = attributes?["url"] ?? '';
  type = attributes?["type"];
  message = attributes?['message'];
  replacement = attributes?["replacement"] ?? false;
  trackEvent = attributes?["trackEvent"];
  trackProductId = attributes?["trackProductId"];

  var prompt = attributes?["prompt"];
  if (prompt is Map<String, dynamic>) {
    var tmp = SDUIParser.getInstance().fromJson(prompt);
    if (tmp is SDUIDialog) {
      this.prompt = tmp;
    }
  }

  var parameters = attributes?["parameters"];
  if (parameters is Map<String, dynamic>) {
    this.parameters = parameters;
  }
  return this;
}