launchBrowserTab function

Future launchBrowserTab(
  1. Uri uri, {
  2. bool popupOpen = false,
})

KO: 기본 브라우저로 URL 실행
popupOpen이 true면 URL을 팝업에서 실행. popupOpen은 웹에서만 사용 가능

EN: Launchs a URL with the default browser
Execute the URL with a pop-up if popupOpen is set true. popupOpen is only available on the web

Implementation

Future launchBrowserTab(Uri uri, {bool popupOpen = false}) async {
  if (uri.scheme != CommonConstants.http &&
      uri.scheme != CommonConstants.scheme) {
    throw KakaoClientException(
      ClientErrorCause.notSupported,
      'Default browsers only supports URL of http or https scheme.',
    );
  }
  final args = {
    CommonConstants.url: uri.toString(),
    CommonConstants.isPopup: popupOpen,
  };

  await _methodChannel.invokeMethod<String>(
      CommonConstants.launchBrowserTab, args);
}