selector library

Properties

debugIsWebOverride bool?
Test-only hook to override whether the current platform should be treated as web.
getter/setter pair
debugTargetPlatformOverride TargetPlatform?
Test-only hook to override the detected TargetPlatform.
getter/setter pair
isDesktop bool
isDesktop device (stub)
no setter
isMobile bool
isMobile device (stub)
no setter

Functions

androidOrElse<T>(T androidValue, T elsePlatform) → T
Returns androidValue if the current platform is Android, otherwise returns elsePlatform (stub).
desktopOrElse<T>(T desktopValue, T elsePlatform) → T
Returns desktopValue if the current device is desktop, otherwise returns elsePlatform (stub).
deviceSelector<T>({required T mobile, required T desktop, required T web, String? debugDeviceType}) → T
Selects a value based on the device type (stub).
fuchsiaOrElse<T>(T fuchsiaValue, T elsePlatform) → T
Returns fuchsiaValue if the current platform is Fuchsia, otherwise returns elsePlatform (stub).
iosOrElse<T>(T iosValue, T elsePlatform) → T
Returns iosValue if the current platform is iOS, otherwise returns elsePlatform (stub).
linuxOrElse<T>(T linuxValue, T elsePlatform) → T
Returns linuxValue if the current platform is Linux, otherwise returns elsePlatform (stub).
macosOrElse<T>(T macosValue, T elsePlatform) → T
Returns macosValue if the current platform is macOS, otherwise returns elsePlatform (stub).
mobileOrElse<T>(T mobileValue, T elsePlatform) → T
Returns mobileValue if the current device is mobile, otherwise returns elsePlatform (stub).
optionalDeviceSelector<T>({T? mobile, T? desktop, T? web, String? debugDeviceType}) → T?
Optional device selector (stub).
optionalSelector<T>({T? web, T? android, T? ios, T? macos, T? fuchsia, T? linux, T? windows}) → T?
Optional selector for known platforms (stub).
selector<T>({required T web, required T android, required T ios, required T macos, required T fuchsia, required T linux, required T windows}) → T
Selects a value based on the current platform (stub).
selectOrElse<T>({T? web, T? android, T? ios, T? macos, T? fuchsia, T? linux, T? windows, required T orElse}) → T
Selects a value based on the current platform, with a fallback orElse value (stub).
webOrElse<T>(T webValue, T elsePlatform) → T
Returns webValue if the current device is web, otherwise returns elsePlatform (stub).
windowsOrElse<T>(T windowsValue, T elsePlatform) → T
Returns windowsValue if the current platform is Windows, otherwise returns elsePlatform (stub).