From eea58c6634e960011f9745917b0a457661ac6900 Mon Sep 17 00:00:00 2001
From: Ellet <73608287+freshtechtips@users.noreply.github.com>
Date: Sun, 5 Nov 2023 23:30:04 +0300
Subject: [PATCH] Disable camera option by default on desktop
---
example/macos/Runner/DebugProfile.entitlements | 2 ++
example/macos/Runner/Release.entitlements | 4 ++++
.../embeds/toolbar/image_button/select_image_source.dart | 2 ++
.../embeds/toolbar/video_button/select_video_source.dart | 2 ++
4 files changed, 10 insertions(+)
diff --git a/example/macos/Runner/DebugProfile.entitlements b/example/macos/Runner/DebugProfile.entitlements
index d6c8ee0c..2302f9b8 100644
--- a/example/macos/Runner/DebugProfile.entitlements
+++ b/example/macos/Runner/DebugProfile.entitlements
@@ -10,5 +10,7 @@
com.apple.security.network.client
+ com.apple.security.files.user-selected.read-only
+
diff --git a/example/macos/Runner/Release.entitlements b/example/macos/Runner/Release.entitlements
index 04336df3..7370dc0b 100644
--- a/example/macos/Runner/Release.entitlements
+++ b/example/macos/Runner/Release.entitlements
@@ -4,5 +4,9 @@
com.apple.security.app-sandbox
+ com.apple.security.network.client
+
+ com.apple.security.files.user-selected.read-only
+
diff --git a/flutter_quill_extensions/lib/presentation/embeds/toolbar/image_button/select_image_source.dart b/flutter_quill_extensions/lib/presentation/embeds/toolbar/image_button/select_image_source.dart
index 3c838934..8753bb87 100644
--- a/flutter_quill_extensions/lib/presentation/embeds/toolbar/image_button/select_image_source.dart
+++ b/flutter_quill_extensions/lib/presentation/embeds/toolbar/image_button/select_image_source.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import 'package:flutter_quill/extensions.dart' show isDesktop;
import '../../embed_types/image.dart';
@@ -27,6 +28,7 @@ class SelectImageSourceDialog extends StatelessWidget {
'Take a photo using your phone camera',
),
leading: const Icon(Icons.camera),
+ enabled: !isDesktop(),
onTap: () => Navigator.of(context).pop(InsertImageSource.camera),
),
ListTile(
diff --git a/flutter_quill_extensions/lib/presentation/embeds/toolbar/video_button/select_video_source.dart b/flutter_quill_extensions/lib/presentation/embeds/toolbar/video_button/select_video_source.dart
index 7187f10b..da2fb8ef 100644
--- a/flutter_quill_extensions/lib/presentation/embeds/toolbar/video_button/select_video_source.dart
+++ b/flutter_quill_extensions/lib/presentation/embeds/toolbar/video_button/select_video_source.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import 'package:flutter_quill/extensions.dart' show isDesktop;
import '../../embed_types/video.dart';
@@ -27,6 +28,7 @@ class SelectVideoSourceDialog extends StatelessWidget {
'Record a video using your phone camera',
),
leading: const Icon(Icons.camera),
+ enabled: !isDesktop(),
onTap: () => Navigator.of(context).pop(InsertVideoSource.camera),
),
ListTile(