setListDefault static method

bool setListDefault(
  1. List? items,
  2. String key,
  3. bool defaultValue
)

Implementation

static bool setListDefault(List? items, String key, bool defaultValue) {
  if (items == null) return defaultValue;
  Map? item =
      items.firstWhere((elem) => elem['name'] == key, orElse: () => null);
  if (item != null) {
    return item['hide'] == 0;
  }
  return defaultValue;
}