MyPlatform class sealed

Available extensions
Annotations
  • @freezed

Constructors

MyPlatform.android()
const
factory
MyPlatform.fuchsia()
const
factory
MyPlatform.ios()
const
factory
MyPlatform.linux()
const
factory
MyPlatform.macos()
const
factory
MyPlatform.web()
const
factory
MyPlatform.windows()
const
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
isAndroid → bool

Available on MyPlatform, provided by the MyPlatformEx extension

no setter
isDesktop → bool

Available on MyPlatform, provided by the MyPlatformEx extension

no setter
isIos → bool

Available on MyPlatform, provided by the MyPlatformEx extension

判断是否为 ios 平台
no setter
isMacos → bool

Available on MyPlatform, provided by the MyPlatformEx extension

no setter
isMobile → bool

Available on MyPlatform, provided by the MyPlatformEx extension

no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>({required TResult android(AndroidPlatform value), required TResult ios(IosPlatform value), required TResult macos(MacosPlatform value), required TResult web(WebPlatform value), required TResult linux(LinuxPlatform value), required TResult windows(WindowsPlatform value), required TResult fuchsia(FuchsiaPlatform value)}) → TResult

Available on MyPlatform, provided by the MyPlatformPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? android(AndroidPlatform value)?, TResult? ios(IosPlatform value)?, TResult? macos(MacosPlatform value)?, TResult? web(WebPlatform value)?, TResult? linux(LinuxPlatform value)?, TResult? windows(WindowsPlatform value)?, TResult? fuchsia(FuchsiaPlatform value)?}) → TResult?

Available on MyPlatform, provided by the MyPlatformPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult android(AndroidPlatform value)?, TResult ios(IosPlatform value)?, TResult macos(MacosPlatform value)?, TResult web(WebPlatform value)?, TResult linux(LinuxPlatform value)?, TResult windows(WindowsPlatform value)?, TResult fuchsia(FuchsiaPlatform value)?, required TResult orElse()}) → TResult

Available on MyPlatform, provided by the MyPlatformPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>({TResult android()?, TResult ios()?, TResult macos()?, TResult web()?, TResult linux()?, TResult windows()?, TResult fuchsia()?, required TResult orElse()}) → TResult

Available on MyPlatform, provided by the MyPlatformPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runInAndroid(VoidCallback call) → Future<void>

Available on MyPlatform, provided by the MyPlatformEx extension

runInAndroidAndIos<T>(Future<T> call()) → Future<T?>

Available on MyPlatform, provided by the MyPlatformEx extension

runInAndroidAndIos2<T>({Future<T?> ios()?, Future<T?> android()?}) → Future<T?>

Available on MyPlatform, provided by the MyPlatformEx extension

runInAndroidAndIos3<T>({T? ios()?, T? android()?}) → T?

Available on MyPlatform, provided by the MyPlatformEx extension

runInIos(VoidCallback call) → Future<void>

Available on MyPlatform, provided by the MyPlatformEx extension

toString() → String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult android(), required TResult ios(), required TResult macos(), required TResult web(), required TResult linux(), required TResult windows(), required TResult fuchsia()}) → TResult

Available on MyPlatform, provided by the MyPlatformPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>({TResult? android()?, TResult? ios()?, TResult? macos()?, TResult? web()?, TResult? linux()?, TResult? windows()?, TResult? fuchsia()?}) → TResult?

Available on MyPlatform, provided by the MyPlatformPatterns extension

A variant of when that fallback to returning null

Operators

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