getPrefixes static method

List<String> getPrefixes(
  1. List<List> conds, [
  2. bool invert = false
])

Implementation

static List<String> getPrefixes(
  List<List<dynamic>> conds, [
  bool invert = false,
]) {
  return conds.map((outer) {
    return outer
        .map((inner) {
          if (inner is _ConditionUtil) {
            var key = 'if';
            if (invert ^ inner.invert) {
              key = 'unless';
            }
            if (inner.str.isNotEmpty) return '$key ${inner.str}';
          }
          return '';
        })
        .join(' ')
        .replaceAll('null ', '');
  }).toList();
}