[web] Migrate Flutter Web to JS static interop - 14. (flutter/engine#32683)

This commit is contained in:
joshualitt
2022-04-25 13:56:02 -07:00
committed by GitHub
parent 75c9e43421
commit 433198af5f

View File

@@ -29,6 +29,7 @@ typedef _HistoryMove = Future<void> Function(int count);
/// bridge from the app to the engine.
@JS()
@anonymous
@staticInterop
abstract class JsUrlStrategy {
/// Creates an instance of [JsUrlStrategy] from a bag of URL strategy
/// functions.
@@ -41,7 +42,9 @@ abstract class JsUrlStrategy {
required _StateOperation replaceState,
required _HistoryMove go,
});
}
extension JsUrlStrategyExtension on JsUrlStrategy {
/// Adds a listener to the `popstate` event and returns a function that, when
/// invoked, removes the listener.
external ui.VoidCallback addPopStateListener(html.EventListener fn);