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(WhereCondition.fromJson),
      isRequired: data['required'],
    );
  }

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