fxKeys
The keys of a Map, as a plain lazy Iterable — ready to wrap in fx() and chain.
Lecture
fxKeys(map) is a thin, FxTS-flavored wrapper around Dart's
own map.keys — it exists mainly so the object-function
vocabulary (fxEntries, fxKeys, fxValues)
reads consistently and slots straight into fx(). Dart's
Map.keys is already a lazy view, so fxKeys
doesn't add any extra buffering — it just hands you the same lazy
Iterable<K>.
Reach for it when you want to filter, transform, or collect a Map's key
set using the rest of the chain vocabulary, rather than reaching for
.where()/.toList() on map.keys
directly — the two are equivalent, but fx(fxKeys(map)) reads
naturally next to fx(fxValues(map)) and
fx(fxEntries(map)).
If you need the keys and values together, use
fxEntries instead — pulling fxKeys and
fxValues separately does not guarantee they line up if the
underlying map were mutated between the two calls.
Demo 1 · Basics
Demo 2 · Filtering a Map by its keys
Try it yourself
Exercise: use fxKeys and sort to get an
alphabetically sorted list of item names.