cockpitCaptureProfilePrefersNative function
bool
cockpitCaptureProfilePrefersNative(
- CockpitCaptureProfile profile, {
- required bool isWeb,
- TargetPlatform? platform,
Implementation
bool cockpitCaptureProfilePrefersNative(
CockpitCaptureProfile profile, {
required bool isWeb,
TargetPlatform? platform,
}) {
if (profile == CockpitCaptureProfile.nativePreferred) return true;
if (isWeb || profile != CockpitCaptureProfile.acceptance) return false;
return switch (platform ?? defaultTargetPlatform) {
TargetPlatform.android || TargetPlatform.iOS => true,
TargetPlatform.fuchsia ||
TargetPlatform.linux ||
TargetPlatform.macOS ||
TargetPlatform.windows => false,
};
}