WebUtils class

Helper providing access to features having different implementations in browser and on native platforms.

Constructors

WebUtils()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

canShareAudio → FutureOr<bool>
Indicates whether this platform supports system audio capture.
no setter
hasPwa ↔ bool
Indicator whether this device has a PWA installed.
getter/setter pair
httpClient → Client?
Returns custom Client to use for HTTP requests.
no setter
isChrome → bool
Indicates whether device's browser is Chrome or not.
no setter
isFirefox → bool
Indicates whether device's browser is Firefox or not.
no setter
isFocused → bool
Indicates whether device's browser is in focus.
no setter
isFullscreen → bool
Indicates whether device's browser is in fullscreen mode or not.
no setter
isLocked → FutureOr<bool>
Indicates whether the protect is currently locked.
no setter
isMacOS → bool
Indicates whether device's OS is macOS or iOS.
no setter
isOnLine → bool
Indicates whether browser is considering to have connectivity status.
no setter
isPopup → bool
Indicates whether the current window is a popup.
no setter
isPwa → bool
Indicates whether this device is considered to be running as a PWA.
no setter
isSafari → bool
Indicates whether device's browser is Safari or not.
no setter
isWindows10 → Future<bool>
Indicates whether the operating system of the device is Windows 10.
no setter
onFocusChanged → Stream<bool>
Returns a stream broadcasting the device's browser focus changes.
no setter
onFullscreenChange → Stream<bool>
Returns a stream broadcasting browser's fullscreen changes.
no setter
onNetworkChange → Stream<ConnectivityResult>
Returns a stream broadcasting the ConnectivityResult of the browser.
no setter
onSelectNotification ↔ void Function(NotificationResponse)?
Callback, called when user taps on a notification.
getter/setter pair
onStorageChange → Stream<WebStorageEvent>
Returns a stream broadcasting the browser's storage changes.
no setter
onWindowFocus → Stream<bool>
Returns a stream broadcasting the browser's window focus changes.
no setter
userAgent → Future<String>
Returns the User-Agent header to put in the network queries.
no setter

Static Methods

bindKey(HotKey key, bool handler()) → Future<void>
Binds the handler to be invoked on the key presses.
cameraPermission() → Future<StreamSubscription<void>>
Requests the permission to use a camera and holds it until unsubscribed.
cleanIndexedDb({String? except}) → Future<void>
Clears the browser's IndexedDB.
cleanStorage() → void
Clears the browser's storage.
clearNotifications(ChatId chatId) → Future<void>
Clears notifications identified by the provided ChatId via registered ServiceWorkers.
closeWindow() → void
Closes the current window.
consoleError(Object? object) → void
Prints a string representation of the provided object to the console as an error.
containsCall(ChatId chatId) → bool
Indicates whether the browser's storage contains a call identified by the provided chatId.
containsCalls() → bool
Indicates whether the browser's storage contains any calls.
deleteLoader() → void
Deletes the loader element.
downloadBlob(String name, Uint8List bytes) → Future<void>
Downloads the provided bytes as a blob file.
downloadFile(String url, String name) → Future<void>
Downloads a file from the provided url.
ensureIsrgCertificate() → Future<void>
Ensures the ISRG Root X1 certificate is trusted on the device.
getCall(ChatId chatId) → WebStoredCall?
Returns a call identified by the provided chatId from the browser's storage.
getCallRect(ChatId chatId) → Rect?
Returns the Rect stored by the provided chatId, if any.
getCredentials(UserId userId) → Credentials?
Returns the stored in browser's storage Credentials identified by the provided UserId, if any.
getGalleryRect() → Rect?
Returns the Rect stored for a openPopupGallery.
microphonePermission() → Future<StreamSubscription<void>>
Requests the permission to use a microphone and holds it until unsubscribed.
moveCall(ChatId chatId, ChatId newChatId, {WebStoredCall? newState}) → void
Moves a call identified by its chatId to the newChatId replacing its stored state with an optional newState.
onBroadcastMessage({String name = 'fcm'}) → Stream
Returns a stream broadcasting the browser's fcm broadcast channel changes.
onPanic(void cb(String)?) → void
Sets callback to be fired whenever Rust code panics.
openPopupCall(ChatId chatId, {bool withAudio = true, bool withVideo = false, bool withScreen = false}) → bool
Opens a new popup window at the Routes.call page with the provided chatId.
openPopupGallery(ChatId chatId, {String? id, int? index}) → bool
Opens a new popup window at the Routes.gallery page with the provided chatId.
pingCall(ChatId chatId) → void
Ensures a call in the provided chatId is considered active the browser's storage.
play(String asset, {bool loop = false}) → Stream<void>
Plays the provided asset.
protect<T>(Future<T> callback(), {bool exclusive = true, String tag = 'mutex'}) → Future<T>
Guarantees the callback is invoked synchronously, only by single tab or code block at the same time.
putCredentials(Credentials creds) → void
Puts the provided Credentials to the browser's storage.
refresh() → Future<void>
Refreshes the current browser's page.
registerScheme() → Future<void>
Registers the custom Config.scheme.
registerWith() → void
Registers the plugins having separate implementations for web and non-web platforms.
removeAllCalls() → void
Removes all calls from the browser's storage, if any.
removeCall(ChatId chatId) → void
Removes a call identified by the provided chatId from the browser's storage.
removeCredentials(UserId userId) → void
Removes Credentials identified by the provided UserId from the browser's storage.
replaceState(String from, String to) → void
Replaces the provided from with the specified to in the current URL.
setAlertFavicon() → void
Sets the favicon being used to an alert style.
setBadge(int count) → void
Refreshes the current browser's page.
setCall(WebStoredCall call) → void
Stores the provided call in the browser's storage.
setCallRect(ChatId chatId, Rect prefs) → void
Sets the prefs as the provided call's popup window preferences.
setDefaultFavicon() → void
Sets the favicon being used to the default style.
setPathUrlStrategy() → void
Sets the URL strategy of your web app to using paths instead of a leading hash (#).
setupAudioSessionManagement(bool value) → Future<void>
Configures whether medea_flutter_webrtc should automatically manage the iOS AVAudioSession.
setupForegroundService() → Future<void>
Ensures foreground service is running to support receiving microphone input when application is in background.
showNotification(String title, {String? dir, String? body, String? lang, String? tag, String? icon, Map<String, dynamic> data = const {}, List<WebNotificationAction> actions = const []}) → Future<void>
Shows a notification via "Notification API" of the browser.
title(String title) → void
Pushes title to browser's window title.
toggleFullscreen(bool enable) → bool
Toggles browser's fullscreen to enable, and returns the resulting fullscreen state.
unbindKey(HotKey key, bool handler()) → Future<void>
Unbinds the handler from the key.