defaultTraversalRequestFocusCallback static method

void defaultTraversalRequestFocusCallback(
  1. FocusNode node, {
  2. ScrollPositionAlignmentPolicy? alignmentPolicy,
  3. double? alignment,
  4. Duration? duration,
  5. Curve? curve,
})

The default value for requestFocusCallback. Requests focus from node and ensures the node is visible by calling Scrollable.ensureVisible.

Implementation

static void defaultTraversalRequestFocusCallback(
  FocusNode node, {
  ScrollPositionAlignmentPolicy? alignmentPolicy,
  double? alignment,
  Duration? duration,
  Curve? curve,
}) {
  node.requestFocus();
  Scrollable.ensureVisible(
    node.context!,
    alignment: alignment ?? 1,
    alignmentPolicy: alignmentPolicy ?? ScrollPositionAlignmentPolicy.explicit,
    duration: duration ?? Duration.zero,
    curve: curve ?? Curves.ease,
  );
}