Action.fromJson constructor
Helper function to create an Action from JSON
Implementation
factory Action.fromJson(Map<String, dynamic> json) {
switch (json['type']) {
case 'goTo':
return GoToAction.fromJson(json);
case 'uri':
return UriAction.fromJson(json);
case 'submitForm':
return SubmitFormAction.fromJson(json);
default:
throw ArgumentError('Unknown action type: ${json['type']}');
}
}