toJson method

  1. @override
Map<String, dynamic> toJson()
override

Serializes this object instance to JSON format.

This method should convert the object's properties into a JSON-serializable format (typically a Map<String, dynamic> or a List).

Returns: A JSON-serializable representation of the object (usually a Map<String, dynamic> or List, but can be any JSON-serializable type).

Example:

final model = MyModel();
final json = model.toJson(); // {'name': 'John', 'age': 30}

Implementation

@override
Map<String, dynamic> toJson() {
  Map<String, dynamic> json = {};
  if (equal != null) {
    json[FilterField.equal] = equal;
  }
  if (notEqual != null) {
    json[FilterField.notEqual] = notEqual;
  }
  if (inList != null) {
    json[FilterField.inList] = inList;
  }
  if (notInList != null) {
    json[FilterField.notInList] = notInList;
  }
  return json;
}