buildCondition method
String?
buildCondition(
)
override
Implementation
@override
String? buildCondition() {
List<QueryCond> flatList = [];
for (QueryCond q in conditions) {
switch (q) {
case FieldCond fc:
flatList.add(fc);
case AndCond ac:
flatList.add(ac);
case OrCond oc:
flatList.addAll(oc.conditions);
}
}
List<String> ls = flatList.mapList((e) => e.buildCondition()).nonNullList.filter((e) => e.isNotEmpty);
if (ls.isEmpty) return null;
if (ls.length == 1) return ls.first;
String s = ls.join(',');
return "[$s]";
}