MyPlatformPatterns extension
Adds pattern-matching-related methods to MyPlatform.
- on
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. -
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