toJson method
Converts a KeyToPath instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempKey = key;
final tempMode = mode;
final tempPath = path;
jsonData['key'] = tempKey;
if (tempMode != null) {
jsonData['mode'] = tempMode;
}
jsonData['path'] = tempPath;
return jsonData;
}