NavigationDelegate.fromPlatform constructor

NavigationDelegate.fromPlatform(
  1. PlatformNavigationDelegate platform, {
  2. NavigationRequestCallback? onNavigationRequest,
  3. PageEventCallback? onPageStarted,
  4. PageEventCallback? onPageFinished,
  5. ProgressCallback? onProgress,
  6. WebResourceErrorCallback? onWebResourceError,
})

Constructs a NavigationDelegate from a specific platform implementation.

Implementation

NavigationDelegate.fromPlatform(
  this.platform, {
  this.onNavigationRequest,
  this.onPageStarted,
  this.onPageFinished,
  this.onProgress,
  this.onWebResourceError,
}) {
  if (onNavigationRequest != null) {
    platform.setOnNavigationRequest(onNavigationRequest!);
  }
  if (onPageStarted != null) {
    platform.setOnPageStarted(onPageStarted!);
  }
  if (onPageFinished != null) {
    platform.setOnPageFinished(onPageFinished!);
  }
  if (onProgress != null) {
    platform.setOnProgress(onProgress!);
  }
  if (onWebResourceError != null) {
    platform.setOnWebResourceError(onWebResourceError!);
  }
}