toggle method

TickerFuture toggle()

Shows the sheet if it is hidden and hides it if it is shown.

Testing

To avoid timeouts in widget tests, always wrap the returned Future in unawaited.

testWidgets('shows', (tester) async {
  await tester.pumpWidget(...);

  unawaited(controller.show());
  await tester.pumpAndSettle();
});

Implementation

TickerFuture toggle() => _controller.toggle();