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) {
  name = json?["name"] ?? '_no_name_';
  value = json?["value"];
  hideText = json?["hideText"] ?? false;
  required = json?["required"] ?? false;
  caption = json?["caption"];
  hint = json?["hint"];
  enabled = json?["enabled"] ?? true;
  readOnly = json?["readOnly"] ?? false;
  type = (json?["type"] ?? "text").toString().toLowerCase();
  maxLines = json?["maxLines"];
  maxLength = json?["maxLength"];
  minLength = json?["minLength"] ?? 0;
  uploadUrl = json?["uploadUrl"];
  imageSource = json?["imageSource"];
  imageMaxWidth = json?["imageMaxWidth"];
  imageMaxHeight = json?["imageMaxHeight"];
  videoMaxDuration = json?["videoMaxDuration"];
  prefix = json?["prefix"];
  suffix = json?["suffix"];
  initialCountry = json?["initialCountry"];
  inputFormatterRegex = json?["inputFormatterRegex"];

  var nodes = json?["countries"];
  if (nodes is List<dynamic>) {
    countries = nodes.map((e) => e.toString()).toList();
  }
  return super.fromJson(json);
}