PlatformAction class

Platform-specific action router.

Constructors

PlatformAction()

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

call<T>({T android()?, T ios()?, T web()?, T macos()?, T desktop()?, T mobile()?}) → T
Calls the platform-specific action.
fallback<T>({T android()?, T ios()?, T web()?, T macos()?, T desktop()?, T mobile()?, required T fallback()}) → T
Calls the platform-specific action or falls back to a default.
maybe<T>({T android()?, T ios()?, T web()?, T macos()?, T desktop()?, T mobile()?}) → T?
Maybe calls the platform-specific action, returns null if not supported.
mobile<T>({required T android(), required T ios(), T desktop()?}) → T
Calls the action for mobile platforms (Android or iOS), with optional desktop fallback. When desktop is provided, it runs on Linux/Windows instead of throwing.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
safe<T>({required T android(), required T ios(), required T web(), required T macos(), T desktop()?}) → T
Safely calls the platform-specific action for current platform.
toString() String
A string representation of this object.
inherited

Operators

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