findByPrefix method
Returns all (path, value) pairs whose path starts with prefix.
Implementation
List<(String, T)> findByPrefix(String prefix) {
final segments = _segments(prefix);
var node = _root;
for (final seg in segments) {
final child = node.children[seg];
if (child == null) return [];
node = child;
}
final results = <(String, T)>[];
_collect(node, segments, results);
return results;
}