Skip to content

Commit a7aadb2

Browse files
committed
Update to v0.1.0 and refactor documentation links
Bumped package versions from 0.1.0-dev.2 to 0.1.0 in pubspec.yaml files. Replaced package README files in packages/nativeapi with symlinks to root documentation, and added a Chinese README. Updated documentation links and examples for consistency.
1 parent 9eb075f commit a7aadb2

6 files changed

Lines changed: 89 additions & 50 deletions

File tree

README-ZH.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# nativeapi
2+
3+
[nativeapi](https://github.com/libnativeapi/libnativeapi) 的 Flutter 绑定 - 提供无缝、统一的原生系统 API 访问。
4+
5+
🚧 **开发中**: 此包目前正在积极开发中。
6+
7+
## 快速开始
8+
9+
`pubspec.yaml` 中添加 `nativeapi`:
10+
11+
```yaml
12+
dependencies:
13+
nativeapi: ^0.1.0
14+
```
15+
16+
然后运行:
17+
18+
```bash
19+
flutter pub get
20+
```
21+
22+
### 使用方法
23+
24+
> 📖 详细的文档和示例即将推出!
25+
26+
```dart
27+
import 'package:nativeapi/nativeapi.dart';
28+
29+
// 示例用法将在此处添加
30+
```
31+
32+
## 开发
33+
34+
### 前置要求
35+
36+
- Flutter (>=3.35.0)
37+
- Dart SDK (>=3.9.0)
38+
39+
### 设置
40+
41+
1. 克隆仓库:
42+
43+
```bash
44+
git clone https://github.com/libnativeapi/nativeapi-flutter.git
45+
cd nativeapi-flutter
46+
```
47+
48+
2. 初始化子模块:
49+
50+
```bash
51+
git submodule update --init --recursive
52+
```
53+
54+
3. 安装依赖:
55+
56+
```bash
57+
melos bootstrap
58+
```
59+
60+
4. 运行示例应用:
61+
62+
```bash
63+
cd examples/display_example
64+
flutter run
65+
```
66+
67+
### FFI 绑定
68+
69+
本项目使用 ffigen 从 C 头文件生成 Dart FFI 绑定。要重新生成绑定:
70+
71+
```bash
72+
cd packages/cnativeapi
73+
dart run ffigen --config ffigen.yaml
74+
```
75+
76+
ffigen 配置定义在 `packages/cnativeapi/ffigen.yaml` 中。通常在以下情况下需要重新生成绑定:
77+
- 原生 C 库 ([libnativeapi/nativeapi](https://github.com/libnativeapi/nativeapi)) 更新时
78+
- ffigen 配置被修改时
79+
80+
## 许可证
81+
82+
[MIT](./LICENSE)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Add `nativeapi` to your `pubspec.yaml`:
1010

1111
```yaml
1212
dependencies:
13-
nativeapi: ^0.1.0-dev.1
13+
nativeapi: ^0.1.0
1414
```
1515
1616
Then run:
@@ -74,7 +74,7 @@ dart run ffigen --config ffigen.yaml
7474
```
7575

7676
The ffigen configuration is defined in `packages/cnativeapi/ffigen.yaml`. You typically need to regenerate bindings when:
77-
- The native C library (libnativeapi) is updated
77+
- The native C library ([libnativeapi/nativeapi](https://github.com/libnativeapi/nativeapi)) is updated
7878
- The ffigen configuration is modified
7979

8080
## License

packages/cnativeapi/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: cnativeapi
22
description: "Native API C bindings for Flutter"
3-
version: 0.1.0-dev.2
3+
version: 0.1.0
44
homepage: https://github.com/libnativeapi/nativeapi-flutter
55
resolution: workspace
66

packages/nativeapi/README-ZH.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README-ZH.md

packages/nativeapi/README.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

packages/nativeapi/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README.md

packages/nativeapi/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: nativeapi
22
description: "Flutter bindings for nativeapi - providing seamless, unified access to native system APIs."
3-
version: 0.1.0-dev.2
3+
version: 0.1.0
44
homepage: https://github.com/libnativeapi/nativeapi-flutter
55
resolution: workspace
66

@@ -12,7 +12,7 @@ dependencies:
1212
ffi: ">=1.2.1 <3.0.0"
1313
flutter:
1414
sdk: flutter
15-
cnativeapi: ^0.1.0-dev.2
15+
cnativeapi: ^0.1.0
1616
path: ^1.9.1
1717
meta: ^1.16.0
1818

0 commit comments

Comments
 (0)