focusControl method

  1. @override
void focusControl(
  1. TFieldRef? aField
)
override

Implementation

@override
void focusControl(TFieldRef? aField) {
  if (aField != null && identical(aField, _field)) {
    // The original code did aField^ := nil (clearing the var
    // parameter, to stop subsequent controls from stealing focus).
    // Dart has no var pointers; the widget layer calls requestFocus
    // if it has one attached.
    final c = control;
    if (c != null) {
      try {
        (c as dynamic).requestFocus();
      } catch (_) {}
    }
  }
}