Skip to content

Commit

Permalink
more on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Oct 5, 2021
1 parent 3e5def1 commit 41355e9
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,27 @@ Future<Uint8List> myFunction(MyTreeNode a, SomeOtherStruct b);

### Get example code

Of course, please [install Flutter](https://flutter.dev/docs/get-started/install), [install Rust](https://www.rust-lang.org/learn/get-started), and have some familiarity with them. Then run `git clone https://github.com/fzyzcjy/flutter_rust_bridge && cd frb_example/complex` to get my example.
Please [install Flutter](https://flutter.dev/docs/get-started/install), [install Rust](https://www.rust-lang.org/learn/get-started), and have some familiarity with them. Then run `git clone https://github.com/fzyzcjy/flutter_rust_bridge && cd frb_example/complex` to get my example.

Or you can use your own code (if you find this Quickstart section too brief, have a look at the later Usage section).

### Run code generator

[WIP should explain this after I publish the codegen package]
Install it: `cargo install flutter_rust_bridge_codegen`.

[WIP later parts]

### Want to see more types that this library can generate?
Run it: `flutter_rust_bridge_codegen frb_example/complex/rust/flutter_rust_bridge.yaml` (the argument is the path to the configuration file).

Have a look at the function arguments and return types in this file: [api.rs](https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/frb_example/simple/rust/src/api.rs). With this library, we have a generated API that resides at [generated_api.dart](https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/frb_example/simple/dart/lib/generated_api.dart) (of course, that is auto generated, and you can use it in other Dart code).
In quickstart, since I have generated the source code, you should not see anything changed.

### Optional: How is this Flutter example created?
### Run Flutter app

[WIP]

## Usage
### Want to see more types that this library can generate?

Have a look at the function arguments and return types in this file: [api.rs](https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/frb_example/simple/rust/src/api.rs). With this library, we have a generated API that resides at [generated_api.dart](https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/frb_example/simple/dart/lib/generated_api.dart) (of course, that is auto generated, and you can use it in other Dart code).

## Usage in details

### Configuration

Expand All @@ -72,9 +74,15 @@ An example is provided [in the example directory](https://github.com/fzyzcjy/flu

For all keys and their meanings of the configuration yaml (`flutter_rust_bridge.yaml`), please refer to [its source code](https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/frb_codegen/src/config.rs).

### Add a line of code

Please put `mod generated_wire;` (where `generated_wire` is the name of the wire file that you choose) into your `lib.rs` or `main.rs`. Only by doing this, Rust can understand that this generated file is a part of your project.

### Run code generator

[WIP should explain this after I publish the codegen package]
Same as the section in Quickstart. Simply run that binary.

### Run the app

[WIP later parts]

Expand Down

0 comments on commit 41355e9

Please sign in to comment.