cunarist / rinf

Rust for native business logic, Flutter for flexible and beautiful GUI
MIT License
1.99k stars 72 forks source link

[proposal] make rust-in-flutter usable for dart-only projects #172

Closed iapicca closed 1 year ago

iapicca commented 1 year ago

Report

rust-in-flutter requires flutter while flutter_rust_bridge supports dart-only projects as well

@Cunarist It seems that there is not a working template for dart ATM

Proposal

add support for dart-only projects

Steps to Reproduce

dart create -t package deleteme && \
cd deleteme && \
dart pub add -d build_runner ffigen freezed && \
dart pub add ffi flutter_rust_bridge freezed_annotation rust_in_flutter
Resolving dependencies...
+ build 2.4.1
+ build_config 1.1.1
+ build_daemon 4.0.0
+ build_resolvers 2.4.0
+ build_runner 2.4.6
+ build_runner_core 7.2.11
+ built_collection 5.1.1
+ built_value 8.6.3
+ checked_yaml 2.0.3
+ cli_util 0.4.0
+ code_builder 4.7.0
+ dart_style 2.3.3
+ ffi 2.1.0
+ ffigen 9.0.1
+ fixnum 1.1.0
+ freezed 2.4.2
+ freezed_annotation 2.4.1
+ graphs 2.3.1
+ json_annotation 4.8.1
+ pubspec_parse 1.2.3
+ quiver 3.2.1
+ source_gen 1.4.0
+ stream_transform 2.1.0
+ timing 1.0.1
+ yaml_edit 2.1.1
Changed 25 dependencies!
Because deleteme depends on rust_in_flutter any which requires the Flutter SDK, version solving failed.

Flutter users should run `flutter pub get` instead of `dart pub get`.

System Information

rustc --version && \
protoc --version && \
flutter doctor
rustc 1.72.1 (d5c2e9c34 2023-09-13) (Homebrew)
libprotoc 24.3
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.13.5, on macOS 13.6 22G120 darwin-arm64, locale en-EE)
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/3.1.2/libexec/bin/dart, which is not inside your current Flutter SDK checkout at
      /Users/yakforward/fvm/versions/stable. Consider adding /Users/yakforward/fvm/versions/stable/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[!] Xcode - develop for iOS and macOS (Xcode 15.0)
    ✗ Unable to get list of installed Simulator runtimes.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.82.2)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 2 categories.