MyPlatform class sealed
- Available extensions
- Annotations
-
- @freezed
Constructors
- MyPlatform.android()
-
constfactory
- MyPlatform.fuchsia()
-
constfactory
- MyPlatform.ios()
-
constfactory
- MyPlatform.linux()
-
constfactory
- MyPlatform.macos()
-
constfactory
- MyPlatform.web()
-
constfactory
- MyPlatform.windows()
-
constfactory
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
Aswitch
-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 ofmap
that fallback to returningnull
. -
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 ofmap
that fallback to returningorElse
. -
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 ofwhen
that fallback to anorElse
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
Aswitch
-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 ofwhen
that fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited