패키지, 저장소 및 앱 카테고리 검색

패키지 상세v2.2.0

ffi

외부 함수 인터페이스(FFI) 코드를 다루는 데 사용하는 유틸리티입니다.

AndroidiOSmacOSWindowsLinux
30일 다운로드
1490만
좋아요
354
Pub 점수
160

패키지 설치

flutter pub add ffi

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

FFI 패키지는 C, Rust 또는 기타 시스템 수준 언어로 작성된 네이티브 코드와 Dart가 상호 작용할 수 있도록 도와주는 유틸리티를 제공합니다. 함수 호출, 데이터 구조 접근 및 언어 경계를 넘나들며 메모리 관리를 가능하게 하여 성능 중심의 작업이나 기존 네이티브 라이브러리 통합에 이상적입니다. Dart가 저수준 시스템 API와 인터페이스하거나 계산 집약적인 작업을 최적화해야 할 때 이 패키지는 필수적입니다. Android, iOS, macOS, Windows, Linux 등 여러 플랫폼을 지원합니다.

사용 사례

  • 네이티브 C 라이브러리 호출
  • Dart 앱에 Rust 코드 통합하기
  • 성능 중심 코드 최적화
  • 시스템 수준의 API에 액세스하기
  • 기존 네이티브 바이너리와의 인터페이스

주요 기능

  • 플랫폼에 관계없는 네이티브 상호 운용성
  • 구조체 및 함수 포인터 지원
  • 네이티브 타입을 통한 메모리 관리
  • 크로스 플랫폼 호환성
  • C 스타일의 API에 직접 바인딩

적합한 대상

  • 네이티브 라이브러리를 사용하는 개발자
  • 성능에 민감한 애플리케이션
  • 시스템 레벨 통합
  • Flutter를 대상으로 한 루스트 또는 C 개발자
  • 직접 하드웨어 접근이 필요한 앱

고려 사항

  • 네이티브 코드에 대한 지식이 필요합니다
  • 잘 사용하지 않으면 충돌 가능성 있음
  • 수동 메모리 관리의 위험
  • 순수 Dart에 비해 유형 안전성이 제한됨
  • 초보자를 위한 학습 곡선이 더 가파릅니다

원본 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.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

순위