WindowController class
Defines behavior of the browser APIs (such as navigation events).
Example
import 'package:universal_html/parsing.dart';
Future<void> main() async {
final controller = WindowController();
await controller.openHttp(
method: 'GET',
uri: Uri.parse('https://www.ietf.org/'),
);
final document = controller.window.document;
// ...
}
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isTopLevelWindowInsideBrowser → bool
-
Returns true if this controller for the top-level window inside a browser.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- window ↔ Window?
-
Gets window controlled by this WindowController.
getter/setter pair
- windowBehavior → WindowBehavior
-
Behavior of the window.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openContent(
String content, {ContentType? contentType}) → void - Opens the content.
-
openFile(
File file) → Future< void> - Opens the file.
-
openHttp(
{String method = 'GET', required Uri uri, ContentType? contentType}) → Future< void> - Loads content using HTTP client.
-
openUri(
Uri uri) → Future< void> - Loads content from "file", "http", or "https" URI.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- topLevel → WindowController
-
Instance returned by top-level
window
variable.final