close method

Future<void> close([
  1. T? result
])

Closes the drawer with an optional result value.

Animates the drawer out using an ease-out cubic curve, then completes the completer with the provided result.

Parameters:

  • result (T?): Optional result to return when drawer closes

Returns a Future that completes when the close animation finishes.

Implementation

Future<void> close([T? result]) {
  return _controlledAnimation.forward(0, Curves.easeOutCubic).then((value) {
    widget.completer.complete(result);
  });
}