findValue<V> method

V findValue<V>(
  1. Map<double, V> map
)

Find the value which matches current size from map

Implementation

V findValue<V>(Map<double, V> map) {
  final entries = map.entries.toList()
    ..sort(((a, b) => b.key.compareTo(a.key)));

  assert(entries.any((element) => element.key == 0));

  return entries.firstWhere((element) => width >= element.key).value;
}