focusNextAcrossManager method
FocusNode?
focusNextAcrossManager({
- NextFocusAction? action,
- List<
FindFocusPosition> ? positions, - bool update = true,
Implementation
FocusNode? focusNextAcrossManager({NextFocusAction? action, List<FindFocusPosition>? positions, bool update = true}){
assert(action != null || positions != null);
final next = action != null ? focusNext(action: action, update: false) : null;
if(next == null){
final nextManager = switch(action){
NextFocusAction.left => findFocusManager(FindFocusPosition.prevLeft)?.firstOrNull,
NextFocusAction.right => findFocusManager(FindFocusPosition.nextRight)?.firstOrNull,
NextFocusAction.up => findFocusManager(FindFocusPosition.father)?.firstOrNull,
NextFocusAction.down => (findFocusManager(FindFocusPosition.focusedChild) ?? findFocusManager(FindFocusPosition.children))?.firstOrNull,
NextFocusAction.back => findFocusManager(FindFocusPosition.father)?.firstOrNull,
NextFocusAction.enter => null,
_ => null
} ?? (positions != null ? findFocusManagerByOrder(positions)?.firstOrNull : null);
if(nextManager != null){
currentFocusNode.blur();
if(nextManager != this){
onBlur(currentFocusNode);
}
if(update) focusUpdate((){});
final newFocusNode = nextManager.focusDefault(update: update);
activeManager = nextManager;
return newFocusNode;
}
}
if(update) focusUpdate((){});
return next;
}