close method

Future<void> close()

Implementation

Future<void> close() {
  final existing = _closeFuture;
  if (existing != null) return existing;
  final owned = controller;
  _controller = null;
  final completion = Completer<void>();
  _closeFuture = completion.future;
  Future<void>.sync(
    owned.platform.closeWebViewSession,
  ).then(completion.complete, onError: completion.completeError);
  return completion.future;
}