From 5c7bede059a09234236497dbbe0784b93f573fa4 Mon Sep 17 00:00:00 2001 From: gtyhn <122523252@qq.com> Date: Tue, 6 Jul 2021 12:44:36 +0800 Subject: [PATCH 1/2] fix the OnImagePickCallback return value (#281) --- lib/src/widgets/toolbar.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/widgets/toolbar.dart b/lib/src/widgets/toolbar.dart index d76ef913..710778ad 100644 --- a/lib/src/widgets/toolbar.dart +++ b/lib/src/widgets/toolbar.dart @@ -31,7 +31,7 @@ export 'toolbar/select_header_style_button.dart'; export 'toolbar/toggle_check_list_button.dart'; export 'toolbar/toggle_style_button.dart'; -typedef OnImagePickCallback = Future Function(File file); +typedef OnImagePickCallback = Future Function(File file); typedef ImagePickImpl = Future Function(ImageSource source); typedef FilePickImpl = Future Function(BuildContext context); typedef WebImagePickImpl = Future Function( From 503127dfa3f47b7d37ca2afdae5a62900c8db51b Mon Sep 17 00:00:00 2001 From: Benjamin Liii Date: Tue, 6 Jul 2021 12:50:11 +0800 Subject: [PATCH 2/2] add the parameter to hide the camera (#278) --- lib/src/widgets/toolbar.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/widgets/toolbar.dart b/lib/src/widgets/toolbar.dart index 710778ad..af36d706 100644 --- a/lib/src/widgets/toolbar.dart +++ b/lib/src/widgets/toolbar.dart @@ -74,6 +74,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { bool showHistory = true, bool showHorizontalRule = false, bool multiRowsDisplay = true, + bool showCamera = true, OnImagePickCallback? onImagePickCallback, FilePickImpl? filePickImpl, WebImagePickImpl? webImagePickImpl, @@ -172,7 +173,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { filePickImpl: filePickImpl, webImagePickImpl: webImagePickImpl, ), - if (onImagePickCallback != null) + if (onImagePickCallback != null && showCamera) ImageButton( icon: Icons.photo_camera, iconSize: toolbarIconSize,