PlatformNavigationDelegate class abstract

Delegate for navigation-related methods of PlatformInAppWebViewController.

Part of the domain-controller split (issue #229, P3): page loading, history management and navigation are grouped behind this focused facade so the main PlatformInAppWebViewController stays easy to reason about.

Platform implementations override the PlatformInAppWebViewController.navigationDelegate getter to return a concrete instance. The default getter returns null, preserving backward compatibility for implementations that have not yet been migrated.

Inheritance
  • Object
  • PlatformInterface
  • PlatformNavigationDelegate

Constructors

PlatformNavigationDelegate({required Object token})
Creates a new PlatformNavigationDelegate.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

canGoBack() → Future<bool>
Returns a boolean value indicating whether the WebView can move backward.
canGoBackOrForward({required int steps}) → Future<bool>
Returns a boolean value indicating whether the WebView can go back or forward the given number of steps. Steps is negative if backward and positive if forward.
canGoForward() → Future<bool>
Returns a boolean value indicating whether the WebView can move forward.
getProgress() → Future<int?>
Gets the progress for the current page. The progress value is between 0 and 100.
getTitle() → Future<String?>
Gets the title for the current page.
getUrl() → Future<WebUri?>
Gets the URL for the current page. This is not always the same as the URL passed to PlatformWebViewCreationParams.onLoadStart because although the load for that URL has begun, the current page may not have changed.
goBack() → Future<void>
Goes back in the history of the WebView.
goBackOrForward({required int steps}) → Future<void>
Goes to the history item that is the number of steps away from the current item. Steps is negative if backward and positive if forward.
goForward() → Future<void>
Goes forward in the history of the WebView.
goTo({required WebHistoryItem historyItem}) → Future<void>
Navigates to a WebHistoryItem from the back-forward WebHistory.list and sets it as the current item.
isLoading() → Future<bool>
Check if the WebView instance is in a loading state.
loadData({required String data, String mimeType = "text/html", String encoding = "utf8", WebUri? baseUrl, WebUri? historyUrl, WebUri? allowingReadAccessTo}) → Future<void>
Loads the given data into this WebView, using baseUrl as the base URL for the content.
loadFile({required String assetFilePath}) → Future<void>
Loads the given assetFilePath.
loadUrl({required URLRequest urlRequest, WebUri? allowingReadAccessTo}) → Future<void>
Loads the given urlRequest.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postUrl({required WebUri url, required Uint8List postData}) → Future<void>
Loads the given url with postData (x-www-form-urlencoded) using POST method into this WebView.
reload() → Future<void>
Reloads the WebView.
stopLoading() → Future<void>
Stops the WebView from loading.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited