cockpitCaptureProfilePrefersNative function

bool cockpitCaptureProfilePrefersNative(
  1. CockpitCaptureProfile profile, {
  2. required bool isWeb,
  3. 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,
  };
}