code method

C code(
  1. WidgetTestCallback testCallback
)

Attaches a code block that injects the WidgetTester directly into the callback.

The codeRun function receives both the BddContext and the WidgetTester currently active for the test.

Implementation

C code(WidgetTestCallback testCallback) {
  return addCode((ctx) async {
    await testCallback(ctx, _widgetContextOf(ctx).tester);
  });
}