ArgsSimple.fromJson constructor

ArgsSimple.fromJson(
  1. Object json
)

Implementation

factory ArgsSimple.fromJson(Object json) {
  if (json is List<String>) {
    return ArgsSimple.parse(json);
  } else if (json is List) {
    return ArgsSimple.parse(json.map((e) => '$e').toList());
  }

  var args = ArgsSimple();

  if (json is Map) {
    args._options.addAll(
        json.map((key, value) => MapEntry(key.toString(), value ?? '')));
  } else {
    var s = '$json';
    args._arguments.add(s);
  }

  return args;
}