fromList static method

ValuableList fromList(
  1. List? list, {
  2. String title = 'name',
  3. String value = 'id',
})

Get list of valuables from a dynamic list

Implementation

static ValuableList fromList(List<dynamic>? list, {String title = 'name', String value = 'id'}) {
  if (list == null) return [];
  return list.map((e) => Valuable(title: e[title], value: e[value].toString())).toList();
}