SystemCameraService class

调起 Android 系统相机(ACTION_IMAGE_CAPTURE / ACTION_VIDEO_CAPTURE), 返回应用自有目录中的结果路径。

为什么不用 image_picker 的相机:image_picker_android 通过 MediaScannerConnection.scanFile 解析拍摄结果路径,而相机输出文件位于应用 内部 cache 目录;魅族(Flyme)的 MediaScanner 会判定为 invalid scan path ... not in any directories 且不再回调, 导致 pickImage/pickVideo 永久挂起、照片/视频静默不发送。 这里由原生侧先创建输出文件,用 FileProvider 交给系统相机,拍摄结束后读取 同一个路径,全程不经过 MediaScanner。

Constructors

SystemCameraService({MethodChannel channel = _defaultChannel})

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

capturePhoto() → Future<PlatformResult<String>>
captureVideo() → Future<PlatformResult<String>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited