|
|
|
@ -6,6 +6,7 @@ import 'package:image_picker/image_picker.dart'; |
|
|
|
|
|
|
|
|
|
import '../../models/documents/nodes/embed.dart'; |
|
|
|
|
import '../../translations/toolbar.i18n.dart'; |
|
|
|
|
import '../../utils/platform_helper.dart'; |
|
|
|
|
import '../controller.dart'; |
|
|
|
|
import '../toolbar.dart'; |
|
|
|
|
|
|
|
|
@ -60,7 +61,7 @@ class ImageVideoUtils { |
|
|
|
|
'Please provide webImagePickImpl for Web ' |
|
|
|
|
'(check out example directory for how to do it)'); |
|
|
|
|
imageUrl = await webImagePickImpl!(onImagePickCallback); |
|
|
|
|
} else if (_isMobile()) { |
|
|
|
|
} else if (isMobile()) { |
|
|
|
|
imageUrl = await _pickImage(imageSource, onImagePickCallback); |
|
|
|
|
} else { |
|
|
|
|
assert(filePickImpl != null, 'Desktop must provide filePickImpl'); |
|
|
|
@ -112,7 +113,7 @@ class ImageVideoUtils { |
|
|
|
|
'Please provide webVideoPickImpl for Web ' |
|
|
|
|
'(check out example directory for how to do it)'); |
|
|
|
|
videoUrl = await webVideoPickImpl!(onVideoPickCallback); |
|
|
|
|
} else if (_isMobile()) { |
|
|
|
|
} else if (isMobile()) { |
|
|
|
|
videoUrl = await _pickVideo(videoSource, onVideoPickCallback); |
|
|
|
|
} else { |
|
|
|
|
assert(filePickImpl != null, 'Desktop must provide filePickImpl'); |
|
|
|
@ -125,8 +126,6 @@ class ImageVideoUtils { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static bool _isMobile() => Platform.isAndroid || Platform.isIOS; |
|
|
|
|
|
|
|
|
|
static Future<String?> _pickVideo( |
|
|
|
|
ImageSource source, OnVideoPickCallback onVideoPickCallback) async { |
|
|
|
|
final pickedFile = await ImagePicker().pickVideo(source: source); |
|
|
|
|