TomFallbackPlatformUtils class

A fallback implementation of TomPlatformUtils.

This class provides default behavior when no platform-specific implementation has been configured. Most methods throw UnimplementedError to indicate that a proper implementation should be provided.

The only methods with working implementations are:

When to Use

This fallback is automatically used when the application hasn't configured a platform implementation. It's primarily useful during testing or when only console output functionality is needed.

Example

// This is the default - no explicit setup needed
TomPlatformUtils.current.out('Hello'); // Works with fallback

// This will throw UnimplementedError with fallback
TomPlatformUtils.current.isDesktop(); // Throws!
Inheritance

Constructors

TomFallbackPlatformUtils()

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

getBrowserLocation() → String?
Returns the current browser URL location, if applicable.
override
getIsolateName() → String
Returns the name of the current isolate.
override
getTomEnvVars() → Map<String, String>
Returns the platform-specific environment variables.
inherited
httpClient() → Client
Creates and returns a platform-appropriate HTTP client.
override
isAndroid() → bool
Returns true if running on Android.
override
isDesktop() → bool
Returns true if running on a desktop platform.
override
isFuchsia() → bool
Returns true if running on Fuchsia OS.
override
isIos() → bool
Returns true if running on iOS.
override
isLinux() → bool
Returns true if running on Linux.
override
isMacOs() → bool
Returns true if running on macOS.
override
isMobile() → bool
Returns true if running on a mobile platform.
override
isWeb() → bool
Returns true if running in a web browser environment.
override
isWindows() → bool
Returns true if running on Microsoft Windows.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
out(String s) → void
Outputs a message to the console.
override
outError(String s) → void
Outputs an error message to the console.
override
toString() → String
A string representation of this object.
inherited

Operators

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