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

패키지 상세v23.0.0

ffigen

C, Objective-C 및 Swift 파일을 파싱하기 위해 LibClang를 사용하는 FFI 바인딩 생성기입니다.

AndroidiOSmacOSWindowsLinux
30일 다운로드
109만
좋아요
338
Pub 점수
160

패키지 설치

flutter pub add ffigen

패키지 개요

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

ffigen은 C, Objective-C 및 Swift 라이브러리용 Dart FFI(외부 함수 인터페이스) 바인딩을 생성하는 코드 생성기입니다. LibClang을 사용하여 네이티브 헤더를 파싱하고 해당하는 Dart 코드를 자동으로 생성함으로써 Dart와 네이티브 코드 간의 원활한 상호 운용성을 가능하게 합니다. 이는 수동으로 바인딩을 만들지 않고도 Dart에서 네이티브 함수를 호출하는 것을 단순화합니다. 성능이 중요한 애플리케이션이나 기존 네이티브 라이브러리를 Flutter 앱에 통합할 때 이상적입니다.

사용 사례

  • Flutter 앱에 C 라이브러리 통합하기
  • Dart에서 네이티브 함수 호출
  • iOS 및 안드로이드용 FFI 바인딩 생성
  • Flutter에서 Swift 라이브러리 사용하기
  • 고성능 네이티브 확장 빌드

주요 기능

  • 자동으로 FFI 바인딩을 생성합니다
  • C, Objective-C 및 Swift를 지원합니다
  • 정확한 구문 분석을 위해 LibClang 사용
  • 깨끗하고 읽기 쉬운 Dart 코드를 생성합니다
  • 사용자 지정 가능한 출력 및 이름 지정

적합한 대상

  • 네이티브 C/C++ 라이브러리를 사용하는 개발자
  • 고성능 네이티브 호출이 필요한 플러터 앱
  • 크로스 플랫폼 네이티브 통합을 유지하는 팀
  • 최소한의 FFI 보일러플레이트를 필요로 하는 프로젝트

고려 사항

  • LibClang 설치가 필요합니다
  • 플랫폼에 특화된 구성이 필요할 수 있습니다
  • 생성된 코드는 수동 조정이 필요할 수 있습니다
  • 동적 또는 런타임 로드 라이브러리에 적합하지 않습니다
  • 일부 플랫폼에서 빌드 설정의 복잡성

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

카테고리

의존성

의존성 목록 18 개

소스 저장소

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

순위