Commit 8983fa7f authored by 张宏's avatar 张宏

1

parent 888c9417
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/device_info_plus-12.4.0/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"flutter_secure_storage","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/zh/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/zh/.pub-cache/hosted/pub.dev/path_provider_foundation-2.6.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"permission_handler_apple","path":"/Users/zh/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.10/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/share_plus-12.0.2/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"shared_preferences_foundation","path":"/Users/zh/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.6/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":true},{"name":"url_launcher_ios","path":"/Users/zh/.pub-cache/hosted/pub.dev/url_launcher_ios-6.4.1/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"vibration","path":"/Users/zh/.pub-cache/hosted/pub.dev/vibration-3.1.8/","native_build":true,"dependencies":[],"dev_dependency":true}],"android":[{"name":"device_info_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/device_info_plus-12.4.0/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"flutter_secure_storage","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/zh/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"jni","path":"/Users/zh/.pub-cache/hosted/pub.dev/jni-1.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"jni_flutter","path":"/Users/zh/.pub-cache/hosted/pub.dev/jni_flutter-1.0.1/","native_build":true,"dependencies":["jni"],"dev_dependency":false},{"name":"path_provider_android","path":"/Users/zh/.pub-cache/hosted/pub.dev/path_provider_android-2.3.1/","native_build":false,"dependencies":["jni","jni_flutter"],"dev_dependency":false},{"name":"permission_handler_android","path":"/Users/zh/.pub-cache/hosted/pub.dev/permission_handler_android-12.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/share_plus-12.0.2/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"shared_preferences_android","path":"/Users/zh/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.23/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"url_launcher_android","path":"/Users/zh/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.30/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"vibration","path":"/Users/zh/.pub-cache/hosted/pub.dev/vibration-3.1.8/","native_build":true,"dependencies":[],"dev_dependency":true}],"macos":[{"name":"device_info_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/device_info_plus-12.4.0/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"flutter_secure_storage_macos","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/zh/.pub-cache/hosted/pub.dev/path_provider_foundation-2.6.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/share_plus-12.0.2/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"shared_preferences_foundation","path":"/Users/zh/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.6/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":true},{"name":"url_launcher_macos","path":"/Users/zh/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.5/","native_build":true,"dependencies":[],"dev_dependency":true}],"linux":[{"name":"device_info_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/device_info_plus-12.4.0/","native_build":false,"dependencies":[],"dev_dependency":true},{"name":"flutter_secure_storage_linux","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"jni","path":"/Users/zh/.pub-cache/hosted/pub.dev/jni-1.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/Users/zh/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/share_plus-12.0.2/","native_build":false,"dependencies":["url_launcher_linux"],"dev_dependency":true},{"name":"shared_preferences_linux","path":"/Users/zh/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"],"dev_dependency":true},{"name":"url_launcher_linux","path":"/Users/zh/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.2/","native_build":true,"dependencies":[],"dev_dependency":true}],"windows":[{"name":"device_info_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/device_info_plus-12.4.0/","native_build":false,"dependencies":[],"dev_dependency":true},{"name":"flutter_secure_storage_windows","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"jni","path":"/Users/zh/.pub-cache/hosted/pub.dev/jni-1.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/Users/zh/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"permission_handler_windows","path":"/Users/zh/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/share_plus-12.0.2/","native_build":true,"dependencies":["url_launcher_windows"],"dev_dependency":true},{"name":"shared_preferences_windows","path":"/Users/zh/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"],"dev_dependency":true},{"name":"url_launcher_windows","path":"/Users/zh/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.5/","native_build":true,"dependencies":[],"dev_dependency":true}],"web":[{"name":"device_info_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/device_info_plus-12.4.0/","dependencies":[],"dev_dependency":true},{"name":"flutter_secure_storage_web","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/zh/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","dependencies":[],"dev_dependency":false},{"name":"permission_handler_html","path":"/Users/zh/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+5/","dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/share_plus-12.0.2/","dependencies":["url_launcher_web"],"dev_dependency":true},{"name":"shared_preferences_web","path":"/Users/zh/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":true},{"name":"url_launcher_web","path":"/Users/zh/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.3/","dependencies":[],"dev_dependency":true}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"fluttertoast","dependencies":[]},{"name":"jni","dependencies":[]},{"name":"jni_flutter","dependencies":["jni"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":["jni","jni_flutter"]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_html","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_html","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]},{"name":"share_plus","dependencies":["url_launcher_web","url_launcher_windows","url_launcher_linux"]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"vibration","dependencies":[]}],"date_created":"2026-06-17 11:32:22.690926","version":"3.38.10","swift_package_manager_enabled":{"ios":false,"macos":false}}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/device_info_plus-12.4.0/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"flutter_secure_storage","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/zh/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/zh/.pub-cache/hosted/pub.dev/path_provider_foundation-2.6.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"permission_handler_apple","path":"/Users/zh/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.10/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/share_plus-12.0.2/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"shared_preferences_foundation","path":"/Users/zh/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.6/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":true},{"name":"url_launcher_ios","path":"/Users/zh/.pub-cache/hosted/pub.dev/url_launcher_ios-6.4.1/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"vibration","path":"/Users/zh/.pub-cache/hosted/pub.dev/vibration-3.1.8/","native_build":true,"dependencies":[],"dev_dependency":true}],"android":[{"name":"device_info_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/device_info_plus-12.4.0/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"flutter_secure_storage","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_usbcamera","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_usbcamera-0.0.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/zh/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"jni","path":"/Users/zh/.pub-cache/hosted/pub.dev/jni-1.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"jni_flutter","path":"/Users/zh/.pub-cache/hosted/pub.dev/jni_flutter-1.0.1/","native_build":true,"dependencies":["jni"],"dev_dependency":false},{"name":"path_provider_android","path":"/Users/zh/.pub-cache/hosted/pub.dev/path_provider_android-2.3.1/","native_build":false,"dependencies":["jni","jni_flutter"],"dev_dependency":false},{"name":"permission_handler_android","path":"/Users/zh/.pub-cache/hosted/pub.dev/permission_handler_android-12.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/share_plus-12.0.2/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"shared_preferences_android","path":"/Users/zh/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.23/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"url_launcher_android","path":"/Users/zh/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.30/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"vibration","path":"/Users/zh/.pub-cache/hosted/pub.dev/vibration-3.1.8/","native_build":true,"dependencies":[],"dev_dependency":true}],"macos":[{"name":"device_info_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/device_info_plus-12.4.0/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"flutter_secure_storage_macos","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/zh/.pub-cache/hosted/pub.dev/path_provider_foundation-2.6.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/share_plus-12.0.2/","native_build":true,"dependencies":[],"dev_dependency":true},{"name":"shared_preferences_foundation","path":"/Users/zh/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.6/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":true},{"name":"url_launcher_macos","path":"/Users/zh/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.5/","native_build":true,"dependencies":[],"dev_dependency":true}],"linux":[{"name":"device_info_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/device_info_plus-12.4.0/","native_build":false,"dependencies":[],"dev_dependency":true},{"name":"flutter_secure_storage_linux","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"jni","path":"/Users/zh/.pub-cache/hosted/pub.dev/jni-1.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/Users/zh/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/share_plus-12.0.2/","native_build":false,"dependencies":["url_launcher_linux"],"dev_dependency":true},{"name":"shared_preferences_linux","path":"/Users/zh/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"],"dev_dependency":true},{"name":"url_launcher_linux","path":"/Users/zh/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.2/","native_build":true,"dependencies":[],"dev_dependency":true}],"windows":[{"name":"device_info_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/device_info_plus-12.4.0/","native_build":false,"dependencies":[],"dev_dependency":true},{"name":"flutter_secure_storage_windows","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"jni","path":"/Users/zh/.pub-cache/hosted/pub.dev/jni-1.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/Users/zh/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"permission_handler_windows","path":"/Users/zh/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/share_plus-12.0.2/","native_build":true,"dependencies":["url_launcher_windows"],"dev_dependency":true},{"name":"shared_preferences_windows","path":"/Users/zh/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"],"dev_dependency":true},{"name":"url_launcher_windows","path":"/Users/zh/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.5/","native_build":true,"dependencies":[],"dev_dependency":true}],"web":[{"name":"device_info_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/device_info_plus-12.4.0/","dependencies":[],"dev_dependency":true},{"name":"flutter_secure_storage_web","path":"/Users/zh/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/zh/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","dependencies":[],"dev_dependency":false},{"name":"permission_handler_html","path":"/Users/zh/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+5/","dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/zh/.pub-cache/hosted/pub.dev/share_plus-12.0.2/","dependencies":["url_launcher_web"],"dev_dependency":true},{"name":"shared_preferences_web","path":"/Users/zh/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":true},{"name":"url_launcher_web","path":"/Users/zh/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.3/","dependencies":[],"dev_dependency":true}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"flutter_usbcamera","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"jni","dependencies":[]},{"name":"jni_flutter","dependencies":["jni"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":["jni","jni_flutter"]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_html","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_html","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]},{"name":"share_plus","dependencies":["url_launcher_web","url_launcher_windows","url_launcher_linux"]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"vibration","dependencies":[]}],"date_created":"2026-06-17 11:45:55.889846","version":"3.38.10","swift_package_manager_enabled":{"ios":false,"macos":false}}
\ No newline at end of file
......@@ -99,5 +99,5 @@ flutter {
}
dependencies {
implementation 'com.github.jiangdongguo.AndroidUSBCamera:libausbc:3.3.3'
// implementation 'com.github.jiangdongguo.AndroidUSBCamera:libausbc:3.3.3'
}
package com.example.laki_icu_app
package com.qialg.laki_icu_app
import com.example.laki_icu_app.camera.UsbCameraPlugin
import com.example.laki_icu_app.camera.UsbCameraViewFactory
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
class MainActivity : FlutterActivity() {
class MainActivity: FlutterActivity() {
}
companion object {
const val USB_CAMERA_CHANNEL = "usb_camera"
const val USB_CAMERA_VIEW_TYPE = "usb_camera_view"
}
private var usbCameraPlugin: UsbCameraPlugin? = null
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
// package com.example.laki_icu_app
// 注册 PlatformViewFactory —— 用于在 Flutter 中渲染摄像头预览画面
flutterEngine
.platformViewsController
.registry
.registerViewFactory(USB_CAMERA_VIEW_TYPE, UsbCameraViewFactory())
// import com.example.laki_icu_app.camera.UsbCameraPlugin
// import com.example.laki_icu_app.camera.UsbCameraViewFactory
// import io.flutter.embedding.android.FlutterActivity
// import io.flutter.embedding.engine.FlutterEngine
// import io.flutter.plugin.common.MethodChannel
// 注册 MethodChannel —— 用于 Flutter 与原生层通信(拍照、录像等控制指令)
val channel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, USB_CAMERA_CHANNEL)
usbCameraPlugin = UsbCameraPlugin(this, channel)
}
// class MainActivity : FlutterActivity() {
override fun onDestroy() {
usbCameraPlugin?.dispose()
super.onDestroy()
}
}
// companion object {
// const val USB_CAMERA_CHANNEL = "usb_camera"
// const val USB_CAMERA_VIEW_TYPE = "usb_camera_view"
// }
// private var usbCameraPlugin: UsbCameraPlugin? = null
// override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
// super.configureFlutterEngine(flutterEngine)
// // 注册 PlatformViewFactory —— 用于在 Flutter 中渲染摄像头预览画面
// flutterEngine
// .platformViewsController
// .registry
// .registerViewFactory(USB_CAMERA_VIEW_TYPE, UsbCameraViewFactory())
// // 注册 MethodChannel —— 用于 Flutter 与原生层通信(拍照、录像等控制指令)
// val channel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, USB_CAMERA_CHANNEL)
// usbCameraPlugin = UsbCameraPlugin(this, channel)
// }
// override fun onDestroy() {
// usbCameraPlugin?.dispose()
// super.onDestroy()
// }
// }
package com.example.laki_icu_app.camera
import android.content.Context
import android.hardware.usb.UsbDevice
import android.view.TextureView
import android.view.View
import com.jiangdg.ausbc.MultiCameraClient
import com.jiangdg.ausbc.callback.ICameraStateCallBack
import com.jiangdg.ausbc.callback.IPreviewDataCallBack
import com.jiangdg.ausbc.camera.bean.CameraRequest
import com.jiangdg.ausbc.camera.bean.PreviewSize
import io.flutter.plugin.common.MethodChannel
import java.io.File
/**
* USB 摄像头管理器(单例)
*
* 职责:
* - 封装 AndroidUSBCamera (libausbc) 的调用
* - 被 UsbCameraPlugin(MethodChannel 控制)和 UsbCameraView(预览画面)共享
*
* 注意:MultiCameraClient 支持多摄像头管理,当前实现先支持第一个 USB 摄像头
*/
object UsbCameraManager {
private var cameraClient: MultiCameraClient? = null
private var textureView: TextureView? = null
private var isOpened = false
private var currentDevice: UsbDevice? = null
/** 获取已连接的 USB 摄像头设备列表 */
fun getDeviceList(context: Context): List<Map<String, Any?>> {
val client = MultiCameraClient(context)
val list = client.getDeviceList()
client.release()
return list.map { device ->
mapOf<String, Any?>(
"deviceId" to device.deviceId,
"deviceName" to device.deviceName,
"vendorId" to device.vendorId,
"productId" to device.productId,
)
}
}
/** 打开指定 USB 摄像头 */
fun openCamera(
context: Context,
textureView: TextureView,
deviceId: Int? = null,
): Boolean {
if (isOpened) {
closeCamera()
}
return try {
val client = MultiCameraClient(context).apply {
// 设置状态回调
setCameraStateCallBack(object : ICameraStateCallBack {
override fun onCameraOpen() {
isOpened = true
}
override fun onCameraClose() {
isOpened = false
}
override fun onCameraError(message: String?) {
isOpened = false
}
override fun onCameraAttached(device: UsbDevice?) {
// USB 摄像头插入时触发
}
override fun onCameraDetached(device: UsbDevice?) {
// USB 摄像头拔出时触发
if (device == currentDevice) {
isOpened = false
}
}
})
}
// 打开摄像头
val config = CameraRequest.Builder()
.setPreviewSize(PreviewSize.PREVIEW_SIZE_720P)
.create()
client.initialize(textureView, config)
client.startPreview()
this.cameraClient = client
this.textureView = textureView
isOpened = true
true
} catch (e: Exception) {
e.printStackTrace()
false
}
}
/** 拍照 */
fun takePhoto(savePath: String?): String? {
val client = cameraClient ?: return null
return try {
val path = savePath
?: "/storage/emulated/0/Pictures/usb_camera_${System.currentTimeMillis()}.jpg"
// 确保目录存在
val file = File(path)
file.parentFile?.mkdirs()
client.capturePicture(path)
path
} catch (e: Exception) {
e.printStackTrace()
null
}
}
/** 开始录像 */
fun startRecord(savePath: String?): Boolean {
val client = cameraClient ?: return false
return try {
val path = savePath
?: "/storage/emulated/0/Movies/usb_camera_${System.currentTimeMillis()}.mp4"
val file = File(path)
file.parentFile?.mkdirs()
client.startRecording(path)
true
} catch (e: Exception) {
e.printStackTrace()
false
}
}
/** 停止录像 */
fun stopRecord(): String? {
val client = cameraClient ?: return null
return try {
client.stopRecording()
} catch (e: Exception) {
e.printStackTrace()
null
}
}
/** 关闭摄像头 */
fun closeCamera() {
try {
cameraClient?.stopPreview()
cameraClient?.release()
} catch (_: Exception) {
// 忽略释放时的异常
}
cameraClient = null
textureView = null
isOpened = false
currentDevice = null
}
/** 查询摄像头是否已打开 */
fun isCameraOpened(): Boolean = isOpened
/** 设置预览分辨率 */
fun setPreviewSize(width: Int, height: Int): Boolean {
// libausbc 的 preview size 在初始化时设置,运行时无法动态切换
// 此处保留接口供后续扩展
return false
}
}
package com.example.laki_icu_app.camera
import android.app.Activity
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
/**
* USB 摄像头 MethodChannel 处理器
*
* 职责:
* - 接收 Flutter 端通过 MethodChannel 发来的控制指令
* - 调用 UsbCameraManager 执行对应操作
* - 通过 result 将结果返回给 Flutter 端
*
* MethodChannel 名称: "usb_camera"
*/
class UsbCameraPlugin(
private val activity: Activity,
private val channel: MethodChannel,
) : MethodChannel.MethodCallHandler {
init {
channel.setMethodCallHandler(this)
}
override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
when (call.method) {
"getDeviceList" -> {
val list = UsbCameraManager.getDeviceList(activity)
result.success(list)
}
"openCamera" -> {
// 此方法由 PlatformView 在创建时通过 Flutter 端调用
// 实际的 openCamera 由 UsbCameraView 在 getView() 时完成
// 这里返回 true 表示准备就绪
result.success(true)
}
"closeCamera" -> {
UsbCameraManager.closeCamera()
result.success(true)
}
"takePhoto" -> {
val path = call.argument<String>("path")
val photoPath = UsbCameraManager.takePhoto(path)
if (photoPath != null) {
result.success(photoPath)
} else {
result.error("TAKE_PHOTO_ERROR", "拍照失败", null)
}
}
"startRecord" -> {
val path = call.argument<String>("path")
val success = UsbCameraManager.startRecord(path)
result.success(success)
}
"stopRecord" -> {
val videoPath = UsbCameraManager.stopRecord()
if (videoPath != null) {
result.success(videoPath)
} else {
result.error("STOP_RECORD_ERROR", "停止录像失败", null)
}
}
"isCameraOpened" -> {
result.success(UsbCameraManager.isCameraOpened())
}
"setPreviewSize" -> {
val width = call.argument<Int>("width") ?: 1280
val height = call.argument<Int>("height") ?: 720
val success = UsbCameraManager.setPreviewSize(width, height)
result.success(success)
}
else -> result.notImplemented()
}
}
fun dispose() {
UsbCameraManager.closeCamera()
}
}
package com.example.laki_icu_app.camera
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.SurfaceTexture
import android.view.TextureView
import android.view.View
import io.flutter.plugin.platform.PlatformView
/**
* USB 摄像头预览 PlatformView
*
* 职责:
* - 内嵌 AndroidUSBCamera 的 TextureView 渲染摄像头预览画面
* - 实现 PlatformView 接口以嵌入 Flutter Widget 树
*
* viewType 注册名称: "usb_camera_view"
*/
class UsbCameraView(
private val context: Context,
viewId: Int,
) : PlatformView {
/** 摄像头预览 TextureView */
private val textureView: TextureView = TextureView(context).apply {
// 当 TextureView 的 SurfaceTexture 就绪后,打开摄像头并开始预览
surfaceTextureListener = object : TextureView.SurfaceTextureListener {
override fun onSurfaceTextureAvailable(
surface: SurfaceTexture,
width: Int,
height: Int,
) {
// Surface 就绪后打开 USB 摄像头
UsbCameraManager.openCamera(context, this@apply)
}
override fun onSurfaceTextureSizeChanged(
surface: SurfaceTexture,
width: Int,
height: Int,
) {
// 尺寸变化时无需额外处理
}
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture): Boolean {
// 当 Surface 销毁时不要关闭摄像头,因为可能是暂时性的
return true
}
override fun onSurfaceTextureUpdated(surface: SurfaceTexture) {
// 每帧更新时回调
}
}
}
override fun getView(): View = textureView
override fun dispose() {
// PlatformView 销毁时释放摄像头资源
UsbCameraManager.closeCamera()
}
}
package com.example.laki_icu_app.camera
import android.content.Context
import io.flutter.plugin.common.StandardMessageCodec
import io.flutter.plugin.platform.PlatformView
import io.flutter.plugin.platform.PlatformViewFactory
/**
* USB 摄像头 PlatformView 工厂
*
* 职责:
* - 告诉 Flutter 如何创建 UsbCameraView 实例
* - 在 MainActivity.configureFlutterEngine() 中注册
*
* 注册名称: "usb_camera_view"
*/
class UsbCameraViewFactory : PlatformViewFactory(StandardMessageCodec.INSTANCE) {
override fun create(context: Context, viewId: Int, args: Any?): PlatformView {
return UsbCameraView(context, viewId)
}
}
......@@ -50,6 +50,8 @@ dependencies:
logger: ^2.7.0
fluttertoast: ^9.0.0
permission_handler: ^11.3.1
flutter_usbcamera: ^0.0.1
# flutter_usbcamera: ^0.0.1
# fl_chart: ^0.71.0
# fl_chart: ^1.1.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment