ShareTarget.fromJson constructor

ShareTarget.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ShareTarget.fromJson(Map<String, dynamic> json) {
  return ShareTarget(
    action: json['action'] as String,
    method: json['method'] as String,
    enctype: json['enctype'] as String,
    title: json.containsKey('title') ? json['title'] as String : null,
    text: json.containsKey('text') ? json['text'] as String : null,
    url: json.containsKey('url') ? json['url'] as String : null,
    files:
        json.containsKey('files')
            ? (json['files'] as List)
                .map((e) => FileFilter.fromJson(e as Map<String, dynamic>))
                .toList()
            : null,
  );
}