找回密码
 立即注册
查看: 336|回复: 0

flutter将proto文件编译成dart文件

[复制链接]
发表于 2022-4-3 09:32 | 显示全部楼层 |阅读模式
1.https://github.com/protocolbuffers/protobuf/releases去这里下载。
2.然后:(在解压缩的目录下执行)
C:\Users\soda\Downloads\protobuf-all-3.20.0\protobuf-3.20.0>dart pub global activate protoc_plugin
3.你会看到:
Pub installs executables into C:\Users\soda\AppData\Local\Pub\Cache\bin, which is not on your path.

3.切到对应目录下(你也可以加到环境变量里去)
C:\Users\soda\AppData\Local\Pub\Cache\bin>protoc --dart_out=E:/test2 -I E:/test2/  rserver.proto

注意:最后那个文件和路径之间有两个空格,切记
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2025-5-8 03:36 , Processed in 0.140004 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表