PlatformUtilsImpl class

Helper providing platform related features.

Constructors

PlatformUtilsImpl()

Properties

activityTimer Timer?
Timer updating the _isActive status after the _activityTimeout has passed.
getter/setter pair
cacheDirectory FutureOr<Directory?>
Returns a path to the cache directory.
no setter
client Dio?
Dio client to use in queries.
getter/setter pair
dio Future<Dio>
Returns a Dio client to use in queries.
no setter
downloadsDirectory Future<Directory>
Returns a path to the downloads directory.
no setter
hashCode int
The hash code for this object.
no setterinherited
isActive Future<bool>
Indicates whether the application is in active state.
no setter
isAndroid bool
Indicates whether device's OS is Android.
no setter
isDesktop bool
Indicates whether device is running on a desktop OS.
no setter
isFocused Future<bool>
Indicates whether the application's window is in focus.
no setter
isIOS bool
Indicates whether device's OS is iOS.
no setter
isLinux bool
Indicates whether device's OS is Linux.
no setter
isMacOS bool
Indicates whether device's OS is macOS.
no setter
isMobile bool
Indicates whether device is running on a mobile OS.
no setter
isWeb bool
Indicates whether application is running in a web browser.
no setter
isWindows bool
Indicates whether device's OS is Windows.
no setter
libraryDirectory FutureOr<Directory>
Returns a path to the library directory.
no setter
onActivityChanged Stream<bool>
Returns a stream broadcasting the application's active status changes.
no setter
onFocusChanged Stream<bool>
Returns a stream broadcasting the application's window focus changes.
no setter
onFullscreenChange Stream<bool>
Returns a stream broadcasting fullscreen changes.
no setter
onMoved Stream<Offset>
Returns a stream broadcasting the application's window position changes.
no setter
onResized Stream<MapEntry<Size, Offset>>
Returns a stream broadcasting the application's window size changes.
no setter
pushNotifications bool
Indicates whether device is running on a Firebase Cloud Messaging supported OS, meaning it supports receiving push notifications.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
temporaryDirectory Future<Directory>
Returns a path to the temporary directory.
no setter
userAgent Future<String>
Returns a User-Agent header to put in the network requests.
no setter

Methods

copy({required String text}) Future<void>
Stores the provided text on the Clipboard.
download(String url, String filename, int? size, {String? path, String? checksum, dynamic onReceiveProgress(int count, int total)?, CancelToken? cancelToken, bool temporary = false, int retries = 5}) Future<File?>
Downloads a file from the provided url.
enterFullscreen() Future<void>
Enters fullscreen mode.
exitFullscreen() Future<void>
Exits fullscreen mode.
fileExists(String filename, {int? size, String? url, bool temporary = false}) Future<File?>
Returns a File with the provided filename and size, if any exist in the downloadsDirectory.
haptic({HapticKind kind = HapticKind.click}) Future<void>
Provides a haptic feedback of the provided kind.
keepActive([bool active = true]) → void
Keeps the _isActive status as active.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pickFiles({FileType type = FileType.any, bool allowCompression = true, int compressionQuality = 30, bool allowMultiple = false, bool withData = false, bool withReadStream = false, bool lockParentWindow = false, List<String>? allowedExtensions}) Future<FilePickerResult?>
Returns the FilePickerResult of the file picking of the provided type.
saveTo(String url, {dynamic onReceiveProgress(int count, int total)?}) Future<File?>
Downloads a file by provided url using save as dialog.
saveToGallery(String url, String name, {String? checksum, int? size, bool isImage = false}) Future<void>
Downloads a video or an image from the provided url and saves it to the gallery.
share(String url, String name, {String? checksum}) Future<void>
Downloads a file from the provided url and opens Share dialog with it.
toString() String
A string representation of this object.
inherited

Operators

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