Serializes this instance to a JSON object.
Map<String, dynamic> toJson() => { 'path': path, if (order != null) 'order': order!.name, };