FileHandler.fromJson constructor

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

Implementation

factory FileHandler.fromJson(Map<String, dynamic> json) {
  return FileHandler(
    action: json['action'] as String,
    name: json['name'] as String,
    icons: json.containsKey('icons')
        ? (json['icons'] as List)
            .map((e) => ImageResource.fromJson(e as Map<String, dynamic>))
            .toList()
        : null,
    accepts: json.containsKey('accepts')
        ? (json['accepts'] as List)
            .map((e) => FileFilter.fromJson(e as Map<String, dynamic>))
            .toList()
        : null,
    launchType: json['launchType'] as String,
  );
}