EditorState.fromJson constructor
EditorState.fromJson(
- Map<String, dynamic> json
)
Implementation
factory EditorState.fromJson(Map<String, dynamic> json) => EditorState(
vimModeEnabled: json['vimModeEnabled'] as bool? ?? false,
keybindingScheme: json['keybindingScheme'] as String? ?? 'default',
tabSize: json['tabSize'] as int? ?? 2,
useSoftTabs: json['useSoftTabs'] as bool? ?? true,
wordWrap: json['wordWrap'] as bool? ?? true,
lineNumbers: json['lineNumbers'] as bool? ?? true,
minimap: json['minimap'] as bool? ?? false,
theme: json['theme'] as String? ?? 'dark',
fontSize: (json['fontSize'] as num?)?.toDouble() ?? 14.0,
fontFamily: json['fontFamily'] as String? ?? 'JetBrains Mono',
bracketMatching: json['bracketMatching'] as bool? ?? true,
autoIndent: json['autoIndent'] as bool? ?? true,
highlightCurrentLine: json['highlightCurrentLine'] as bool? ?? true,
customKeybindings:
(json['customKeybindings'] as Map<String, dynamic>?)?.map(
(k, v) => MapEntry(k, v.toString()),
) ??
{},
);