cunarist / rinf

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

How to use enums with protobuf ? #159

Closed LucaCoduriV closed 1 year ago

LucaCoduriV commented 1 year ago

Report

When I try to use enums my proto file does not compile anymore. here are the logs:

Building package executable... 
Built rust_in_flutter:rust_in_flutter.
Verifying `protoc-gen-prost` for Rust. This might take a while if there are new updates to be installed.
Unhandled exception:
Exception: Could not compile `.proto` files into Rust
#0      _generateMessageCode (file:///home/luca/.pub-cache/hosted/pub.dev/rust_in_flutter-4.1.4/bin/rust_in_flutter.dart:398:7)
<asynchronous suspension>
#1      main (file:///home/luca/.pub-cache/hosted/pub.dev/rust_in_flutter-4.1.4/bin/rust_in_flutter.dart:11:5)
<asynchronous suspension>

here is my proto file:

syntax = "proto3";
package app_event;

message SignalAppEvent {
  enum AppEventType {
    Update = 0;
    ShowNotificationCenter = 1;
    HideNotificationCenter = 2;
  }
  AppEventType type = 0;
}

System Information

rustc --version
protoc --version
flutter doctor
rustc 1.71.1 (eb26296b5 2023-08-03)
libprotoc 24.2
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.4, on EndeavourOS 6.5.3-arch1-1, locale en_US.UTF-8)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for
      detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (not installed)
[✓] Connected device (1 available)
[✓] Network resources

! Doctor found issues in 3 categories.