fromController static method

Future<OffscreenWebViewSession> fromController(
  1. WebViewController controller
)

Transfers ownership of controller to a new offscreen session.

The caller must not independently retain or use controller after the returned session is closed.

Implementation

static Future<OffscreenWebViewSession> fromController(
  WebViewController controller,
) async {
  if (!await controller.isOffscreenWebViewSupported()) {
    throw UnsupportedError(
      'Offscreen WebView sessions are not supported on the current platform.',
    );
  }
  return OffscreenWebViewSession._(controller);
}