submitTextOnFinder method

Future<void> submitTextOnFinder(
  1. Finder finder, {
  2. TestStep? step,
  3. Future<void> onBeforeSubmit()?,
})

Implementation

Future<void> submitTextOnFinder(
  Finder finder, {
  TestStep? step,
  Future<void> Function()? onBeforeSubmit,
}) async {
  await _ensureTextTargetReady(finder, 'submitText');
  await tapFinder(
    finder,
    step: step,
    onBeforeTap: () async {
      if (step != null) await _emitEvidenceBoundary(step);
      await onBeforeSubmit?.call();
    },
  );
  await tester.testTextInput.receiveAction(TextInputAction.done);
  await runtime.settleAfterAction();
}