focusPrevious method

bool focusPrevious()

Move focus to the previous focusable node in widget-tree order. Mirror of focusNext; wraps from the first node to the last.

Implementation

bool focusPrevious() {
  final current = _primaryFocus;
  if (current == null) {
    final last = rootScope.traversalPolicy.findLastFocus(rootScope);
    if (last == null) return false;
    last.requestFocus();
    return true;
  }
  return _policyFor(current).previous(current);
}