Upon reading the README file of barcode_scan plugin I encountered the instruction

This plugin is written in Kotlin. Therefore, you need to add Kotlin support to your project. See installing the Kotlin plugin.

该链接仅提供有关在Android Studio中创建Kotlin项目的信息.如何为Flutter 项目添加Kotlin个支持?有必要吗?

EDIT: Since I already have an existing flutter package, I am looking for ways to add Kotlin support to that project

推荐答案

You simply have to add a single file in Kotlin format (example under android>main>java>your packagename>test.kt and it will automatically upgrade. Can be an empty file. Add it using android studio. answer reference: https://github.com/mintware-de/flutter_barcode_reader/issues/121

Kotlin相关问答推荐

Lambda和普通Kotlin函数有什么区别?

如果一项工作失败,请继续在Kotlin 等待其他工作/子元素完成

如何在使用Kotlin Coroutines时检测和记录何时出现背压

新的jOOQ Gradle插件无法正确处理自引用关系

Kotlin编译器如何决定是否可以在任何给定点调用Suspend方法?

T和T有什么区别:任何>

在 detekt 配置文件中找不到某些属性

在协程上下文中重新抛出异常

如何将光标从一个文本字段传递到 Jetpack Compose 中的其他文本字段?

Flow.state In() 未从其来源接收新值

如何使用函数类型或 lambdas 作为 Kotlin 上下文接收器的类型?

在子类中覆盖 kotlin 运算符扩展函数

Jetpack Compose:当状态从另一个活动改变时强制重组

参考 Kotlin 中的 Java 接口静态字段

Kotlin 解构超过五个组件

Kotlin - 覆盖方法中的 IllegalArgumentException

kotlin:扩展方法和空接收器

从片段(fragment)中的点击事件启动协同程序

Java Integer.MAX_VALUE 与 Kotlin Int.MAX_VALUE

Kotlin 对象 vs 伴生对象(companion-object) vs 包作用域(package scoped)方法