FileChangeEvent.fromJson constructor

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

Implementation

factory FileChangeEvent.fromJson(Map<String, dynamic> json) {
  return FileChangeEvent(
    path: json['path'] as String,
    type: FileChangeType.values.firstWhere(
      (e) => e.name == json['type'],
      orElse: () => FileChangeType.modify,
    ),
  );
}