call<T> method
T
call<T>({
- T android()?,
- T ios()?,
- T web()?,
- T macos()?,
- T desktop()?,
- T mobile()?,
Calls the platform-specific action.
Implementation
T call<T>({
T Function()? android,
T Function()? ios,
T Function()? web,
T Function()? macos,
T Function()? desktop,
T Function()? mobile,
}) {
final value = maybe(
android: android,
ios: ios,
web: web,
macos: macos,
desktop: desktop,
mobile: mobile,
);
if (value == null) {
throw UnsupportedError('Unsupported platform');
}
return value;
}