fromJSON method

  1. @override
void fromJSON(
  1. dynamic json
)
override

Deserialize data from JSON

Implementation

@override
void fromJSON(dynamic json) {
  if (json is! Map<String, dynamic>) {
    return;
  }

  if (json.containsKey(FilterField.greaterEqual)) {
    greaterEqual = DateTime.parse(json[FilterField.greaterEqual]);
  }
  if (json.containsKey(FilterField.lessEqual)) {
    lessEqual = DateTime.parse(json[FilterField.lessEqual]);
  }
  if (json.containsKey(FilterField.greater)) {
    greater = DateTime.parse(json[FilterField.greater]);
  }
  if (json.containsKey(FilterField.less)) {
    less = DateTime.parse(json[FilterField.less]);
  }
  if (json.containsKey(FilterField.equal)) {
    equal = DateTime.parse(json[FilterField.equal]);
  }
  if (json.containsKey(FilterField.notEqual)) {
    notEqual = DateTime.parse(json[FilterField.notEqual]);
  }
}