afterEach function

void afterEach(
  1. Future<void> body(
    1. WidgetTester tester
    )
)

Registers a function to be run after tests.

This function will be called after each test is run.

If this is called within a describe/context, it applies only to tests in that describe/context. The body will be run before any tear-down callbacks in parent describe/context or at the top level.

Each callback at the top level or in a given describe/context will be run in the reverse of the order they were declared.

Implementation

void afterEach(Future<void> Function(WidgetTester tester) body) {
  _widgetDeclarer.tearDown(body);
}