underWidget method
Any operations applied within the underHere callback operate on
widgets which are nested under selector.
In addition to passing a standard selector, like a AFWidgetID, you can also
pass in a list of selectors. If you do so, then the operation takes place
under a sparse-path containing all the items in the list.
Implementation
Future<void> underWidget(dynamic selector, Future<void> Function() underHere) async {
var path = activeSelectorPath;
path ??= AFSparsePathWidgetSelector.createEmpty();
var next = path;
if(selector is List) {
for(final sel in selector) {
next = AFWidgetSelector.createSelector(next, sel) as AFSparsePathWidgetSelector;
}
} else {
next = AFWidgetSelector.createSelector(next, selector) as AFSparsePathWidgetSelector;
}
underPaths.add(next);
await underHere();
underPaths.removeLast();
}