如何使用 ChoiceChip 小部件为所选芯片的文本设置特定颜色?“selectedColor”仅设置所选芯片的背景颜色。
使用 Android 拍照变得非常慢。之前工作得很好。我只更新了 Flutter 和我的库。我使用的是最新版本的相机0.10.5+2(但与之前的版本有同样的问题)。
我的代码
void initState() {
super.initState();
_cameraController = CameraController(widget.camera, ResolutionPreset.medium, enableAudio: false,);
_cameraController.setFocusMode(FocusMode.locked);
_cameraController.setFlashMode(FlashMode.off);
_initializeControllerFuture = _cameraController.initialize();
}
Future<void> takePhoto({bool? oneShot}) async {
await _initializeControllerFuture;
XFile photo = await _cameraController.takePicture();
}
Run Code Online (Sandbox Code Playgroud)
我的日志
D/CameraCaptureCallback( 5282): CameraCaptureCallback | state: STATE_WAITING_FOCUS | afState: 2 | aeState: 2
Run Code Online (Sandbox Code Playgroud)
上面这行出现了 50 次
D/CameraCaptureCallback( 5282): CameraCaptureCallback | state: STATE_WAITING_FOCUS | afState: 2 | aeState: 2
W/CameraCaptureCallback( 5282): Focus timeout, moving on with capture
I/Camera ( 5282): captureStillPicture
D/Camera ( 5282): …Run Code Online (Sandbox Code Playgroud) 我收到这个错误。
无法转换 firebase-auth-22.2.0.aar (com.google.firebase:firebase-auth:22.2.0) 以匹配属性 {artifactType=android-dex、asm-transformed-variant=NONE、dexing-enable-desugaring = true,dexing-enable-jacoco-instrumentation = false,dexing-is-debuggable = true,dexing-min-sdk = 21,org.gradle.category =库,org.gradle.libraryelements = jar,org.gradle.status =发布,org.gradle.usage = java运行时}。
我尝试更新 kotlin,构建 gradle,所有库,flutter clean,使缓存无效......没有任何效果。
这是我的配置
ext.kotlin_version = '1.8.22'
minSdkVersion 21
targetSdkVersion 34
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.4.0'
implementation platform('com.google.firebase:firebase-bom:31.2.0')
Run Code Online (Sandbox Code Playgroud)
我还能做什么?