Ejemplo n.º 1
0
 public FocusAttachment attach(BuildContext context, FocusOnKeyCallback onKey = null)
 {
     _context    = context;
     _onKey      = onKey ?? _onKey;
     _attachment = new FocusAttachment(this);
     return(_attachment);
 }
Ejemplo n.º 2
0
 public void _initNode()
 {
     if (widget.focusNode == null)
     {
         _internalNode = _internalNode ?? _createNode();
     }
     if (widget.skipTraversal != null)
     {
         focusNode.skipTraversal = widget.skipTraversal.Value;
     }
     if (widget.canRequestFocus != null)
     {
         focusNode.canRequestFocus = widget.canRequestFocus.Value;
     }
     _canRequestFocus = focusNode.canRequestFocus;
     _hasPrimaryFocus = focusNode.hasPrimaryFocus;
     _focusAttachment = focusNode.attach(context, onKey: widget.onKey);
     focusNode.addListener(_handleFocusChanged);
 }