NotebookEditInput.fromMap constructor

NotebookEditInput.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory NotebookEditInput.fromMap(Map<String, dynamic> map) {
  return NotebookEditInput(
    notebookPath: map['notebook_path'] as String? ?? '',
    command: map['command'] as String? ?? '',
    cellIndex: (map['cell_index'] as num?)?.toInt() ?? 0,
    cellType: map['cell_type'] as String?,
    source: map['source'] as String? ?? map['content'] as String?,
    newIndex:
        (map['new_index'] as num?)?.toInt() ??
        (map['target_index'] as num?)?.toInt(),
  );
}