fromJson method

  1. @override
SDUIWidget fromJson(
  1. Map<String, dynamic>? json
)
override

Load the attributes of the widget descriptor from

Implementation

@override
SDUIWidget fromJson(Map<String, dynamic>? json) {
  title = json?['title'];
  message = json?['message'];
  type = json?['type'];

  var actions = json?["actions"];
  if (actions is List<dynamic>) {
    this.actions = [];
    actions.map((it) => _parseAction(it)).forEach((it) {
      if (it != null) {
        it.action.inDialog =
            true; // Set this flag so that the dialog is clicked when executed
        this.actions?.add(it);
      }
    });
  }

  return this;
}