focus method

  1. @override
void focus()
override

Item/component focuses itself

Implementation

@override
void focus() {
  if (_resolvedFocusable != null) {
    _resolvedFocusable!.focus();
    return;
  }
  focusDelegate.then((delegate) {
    assert(delegate is Focusable || delegate is Element);
    if (delegate is Focusable) {
      _resolvedFocusable = delegate;
    } else {
      _resolvedFocusable = RootFocusable(delegate);
    }
    _resolvedFocusable!.focus();
  });
}