搜索插件、代码仓与 APP 分类

插件详情v1.0.1

jnigen

一个用于 Java 和 Kotlin 的 Dart 绑定生成器,使用 JNI 在底层实现与 Java 虚拟机的互操作。

AndroidiOSmacOSWindowsLinux
近 30 天下载
5.5万
喜欢数
133
Pub 分数
160

安装插件

flutter pub add jnigen

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Jnigen 是一个 Dart 包,用于生成 Java 和 Kotlin 代码的绑定,通过 JNI 实现与 Java 虚拟机的无缝互操作。它简化了在跨平台应用中从 Dart 调用 Java/Kotlin 函数的过程,特别适用于 Android 和其他基于 JVM 的环境。该工具自动化创建原生接口,减少样板代码并提高集成可靠性。它是 Dart Native 生态系统的一部分,支持包括 Android、iOS、macOS、Windows 和 Linux 在内的多个平台。

适合场景

  • 从 Dart 调用 Java/Kotlin 库
  • 集成原生 Android SDK
  • 使用JVM代码扩展Dart应用
  • 跨平台移动开发
  • 使用原生性能构建混合应用

主要特点

  • 自动生成 JNI 绑定
  • 对 Java 和 Kotlin 的支持
  • 多平台兼容性
  • 与 Dart 原生生态系统的集成
  • 减少手动 JNI 编码

适合对象

  • 面向 Android 的 Dart 开发人员
  • 使用 Java/Kotlin 库的团队
  • 需要高性能原生互操作的项目
  • 混合应用开发者
  • 跨平台移动开发团队

使用建议

  • 需要了解 JNI 概念
  • 仅限 JVM 兼容平台
  • 可能增加构建复杂性
  • 不适用于纯Flutter应用
  • 由于原生依赖项,应用程序大小可能更大

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Coverage Status

Overview

This repository is home to Dart packages related to FFI and native assets building and bundling.

Documentation

See the doc directory for more documentation.

Packages

Package Description Issues Version
code_assets This package contains the Dart API for code assets in hook/build.dart and hook/link.dart. issues pub package
data_assets This package contains the Dart API for data assets in hook/build.dart and hook/link.dart. issues pub package
ffi Utilities for working with Foreign Function Interface (FFI) code. issues pub package
ffigen Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files. issues pub package
hooks This package contains the API for hook/build.dart and hook/link.dart. issues pub package
hooks_runner This package is the backend that invokes hook/build.dart and hook/link.dart from Dart and Flutter. issues pub package
jni A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen. issues pub package
jni_flutter A library to access Flutter Android specific APIs from Dart. issues pub package
jni_util A library to access Flutter Android specific APIs from Dart. issues pub package
jnigen A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine. issues pub package
native_toolchain_c A library to invoke the native C compiler installed on the host machine. issues pub package
objective_c A library to access Objective C from Flutter that acts as a support library for package:ffigen. issues pub package
record_use Dart API to access @RecordUse() recorded usages in link hooks. issues pub package
swift2objc A tool for generating bindings that allow interop between Dart and Swift code. issues pub package
swiftgen A tool for generating bindings that allow interop between Dart and Swift code. issues pub package

External packages

Packages not on this repo but also related to FFI and native assets. ❤️

Package Description Version
native_toolchain_cmake A library to invoke CMake for Dart Native Assets. pub package
native_toolchain_go A library to invoke the native Go compiler installed on the host machine. pub package
native_toolchain_ninja A library to invoke Ninja for Dart Native Assets. pub package
native_toolchain_rust A library to build and bundle Rust code for Dart Native Assets. pub package
native_toolchain_zig A library to build and bundle Zig code for Dart Native Assets. pub package

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

For additional information about contributing, see our contributing page.

所属分类

依赖

依赖清单 11 项

源码仓库

使用此插件的项目

所在榜单