android - 我正在使用 MLkit,并希望将返回的原始值放入 Dropbox/组合框
问题描述
我正在使用 MLkit,并希望将返回的原始值放入 Dropbox/组合框。目前我列出了它们。
请看下面的代码:
return Expanded(
flex: 1,
child: Container(
child: ListView.builder(
padding: const EdgeInsets.all(1.0),
itemCount: barcodes.length,
itemBuilder: (context, i) {
var text;
final barcode = barcodes[i];
switch (widget._scannerType) {
case BARCODE_SCANNER:
VisionBarcode res = barcode as VisionBarcode;
text = "Detected Attribute: ${res.rawValue}";
break;
case LABEL_SCANNER:
VisionLabel res = barcode as VisionLabel;
text = "Detected Attribute: ${res.label}";
break;
}
return _buildTextRow(text);
Widget _buildTextRow(text) {
return ListTile(
title: Text(
"$text",
),
dense: true,
);
}
解决方案
推荐阅读
- kubernetes - FailedCreatePodSandBox & kubelet, $(Slave name) Pod 沙箱改变,会被杀死重新创建
- tensorflow-serving - OpenVINO 服务 - 未找到请求的可服务
- python - Python3:使用 exec() 创建函数
- android - SwitchPreference 点击开关不会触发监听器
- php - 使用实体类时如何修复找不到类?如何在对象中显示数据库?
- javascript - 如何通过 Javascript 提交带有自定义变量的表单?
- c++ - 从 initializer_list 初始化 std::array
- reactjs - 在 Grommet DataTable Reactjs 上设置唯一键
- c - 如何处理分配的字符串输入?
- php - 如何显示 php myadmin 记录数