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

插件详情v1.1.0

jni_flutter

一个库,用于从 Dart 访问 Flutter Android 特定 API。

Android
近 30 天下载
458万
喜欢数
17
Pub 分数
140

安装插件

flutter pub add jni_flutter

插件介绍

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

jni_flutter 包使 Flutter 应用中的 Dart 代码能够通过 JNI(Java Native Interface)直接与 Android 原生 API 交互。它提供了一个桥梁,用于调用 Android Java/Kotlin 方法并访问标准 Flutter 插件未暴露的平台特定功能。对于需要低级别访问 Android 系统组件的高级用例(如自定义硬件集成或深层系统级操作)尤其有用。该包是 Dart Native 生态系统的一部分,专为需要与 Android 原生环境紧密集成的开发者设计。

适合场景

  • 访问 Flutter 中不可用的 Android 系统 API
  • 集成自定义原生 Android 库
  • 实现性能关键的 Android 特定功能
  • 通过原生平台功能扩展Flutter应用
  • 开发专用硬件集成

主要特点

  • 从 Dart 直接访问 JNI
  • 支持 Android 特定的原生方法调用
  • Dart Native 生态系统的一部分
  • 启用对 Android 系统的低级别交互
  • 促进与现有 Android 原生代码的集成

适合对象

  • 高级Flutter开发人员
  • Android 平台专家
  • 需要原生 Android 访问权限的项目
  • 使用自定义 Android 库的开发者
  • 需要深度系统集成的应用

使用建议

  • 需要具备 Android 原生开发知识
  • 仅限 Android 平台
  • 可能增加应用的复杂性和维护成本
  • 不适合初学者
  • 存在平台特定的错误和兼容性问题

原始 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.

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

所在榜单