From 195ccd7c7e2c0e5152e1fb1047c2ccc73e25f31e Mon Sep 17 00:00:00 2001 From: Xin Yao Date: Wed, 23 Jun 2021 09:52:55 -0700 Subject: [PATCH] Update _pickImageWeb method --- lib/src/widgets/toolbar/image_button.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/widgets/toolbar/image_button.dart b/lib/src/widgets/toolbar/image_button.dart index e7ec6a2f..a94fa89a 100644 --- a/lib/src/widgets/toolbar/image_button.dart +++ b/lib/src/widgets/toolbar/image_button.dart @@ -62,7 +62,7 @@ class ImageButton extends StatelessWidget { imageUrl = await imagePickImpl!(imageSource); } else { if (kIsWeb) { - imageUrl = await _pickImageWeb(); + imageUrl = await _pickImageWeb(onImagePickCallback!); } else if (Platform.isAndroid || Platform.isIOS) { imageUrl = await _pickImage(imageSource); } else { @@ -76,7 +76,7 @@ class ImageButton extends StatelessWidget { } } - Future _pickImageWeb() async { + Future _pickImageWeb(OnImagePickCallback onImagePickCallback) async { final result = await FilePicker.platform.pickFiles(); if (result == null) { return null; @@ -86,7 +86,7 @@ class ImageButton extends StatelessWidget { final fileName = result.files.first.name; final file = File(fileName); - return onImagePickCallback!(file); + return onImagePickCallback(file); } Future _pickImage(ImageSource source) async {