organizeSizeOrders static method

List<String> organizeSizeOrders(
  1. String orders, {
  2. Map<String, bool>? hiddenMap,
})

Implementation

static List<String> organizeSizeOrders(String orders,
    {Map<String, bool>? hiddenMap}) {
  List<String> result = [];
  if (orders.trim().isEmpty) {
    return result;
  } else {
    result = orders
        .toLowerCase()
        .trim()
        .split(' ')
        .where((String order) => order.trim().isNotEmpty)
        .toList();
    if (hiddenMap != null) {
      for (final String pfx in result) {
        if (allPrefixList.contains(pfx)) {
          hiddenMap[pfx == 'xs' ? '' : pfx] = true;
        }
      }
    }
    return result;
  }
}