fromList static method

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

Implementation

static List<Valuable> 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();
}