flutter_web_plugins library

The platform channels and plugin registry implementations for the web implementations of Flutter plugins.

This library provides the Registrar class, which is used in the registerWith method that is itself called by the code generated by the flutter tool for web applications.

See also:


Delegates to real browser APIs to provide platform location functionality.
This is an implementation of UrlStrategy that uses the browser URL's hash fragments to represent its state.
Uses the browser URL's pathname to represent Flutter's route name.
Encapsulates all calls to DOM apis, which allows the UrlStrategy classes to be platform agnostic and testable.
A named channel for sending events to the framework-side using streams.
This class was previously separate from Registrar but was merged into it as part of a simplification of the web plugins API.
A registrar for Flutter plugins implemented in Dart.
Represents and reads route state from the browser's URL.


pluginBinaryMessenger BinaryMessenger
A deprecated alias for webPluginRegistrar.
no setter
urlStrategy UrlStrategy?
Returns the present UrlStrategy for handling the browser URL.
getter/setter pair
webPluginRegistrar Registrar
The default plugin registrar for the web.
webPluginRegistry PluginRegistry
A deprecated alias for webPluginRegistrar.
no setter


checkBaseHref(String? baseHref) String
Checks that baseHref is set.
ensureLeadingSlash(String path) String
Prepends a forward slash to path if it doesn't start with one already.
extractPathname(String url) String
Extracts the pathname part of a full url.
setUrlStrategy(UrlStrategy? strategy) → void
Change the strategy to use for handling browser URL.
stripTrailingSlash(String path) String
Removes the trailing forward slash from path if any.
usePathUrlStrategy() → void
Use the PathUrlStrategy to handle the browser URL.


EventListener = dynamic Function(Object event)
Function type that handles pop state events.