WhereCondition.fromJson constructor

WhereCondition.fromJson(
  1. Map<String, dynamic> data
)

Implementation

factory WhereCondition.fromJson(Map<String, dynamic> data) {
  if (data['subclass'] == 'WherePhrase') {
    return WherePhrase(
      data['conditions'].map((s) => WhereCondition.fromJson(s)),
      required: data['required'],
    );
  }

  return Where(
    data['evaluatedField'],
    value: data['value'],
    compare: Compare.values[data['compare']],
    required: data['required'],
  );
}