toMap<K, U> method

Map<K, U> toMap<K, U>({
  1. required K funcKey(
    1. T item
    )?,
  2. required U funcValue(
    1. T item
    )?,
})

Implementation

Map<K, U> toMap<K, U>({ required K Function(T item)? funcKey, required U Function(T item)? funcValue }) {
	assert(funcKey != null);
	assert(funcValue != null);

	Map<K, U> map = { for (var item in this) funcKey!(item) : funcValue!(item) };
	return map;
}