如何使用dart-protobuf [英] How to use dart-protobuf

查看:1316
本文介绍了如何使用dart-protobuf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑在我的一个项目中使用 dart-protobuf 而不是JSON 。问题是,图书馆没有提供任何使用它的例子,测试也没有真正帮助。

I'm considering using dart-protobuf instead of JSON in one of my projects. The problem is that the library does not provide any example of how to use it, and the tests don't really help either.

我也有点困惑如何解析 .proto 文件将有效。

I'm also a bit confused on how the parsing of .proto files would work.

所以我在寻找一个简单的例子,在dart中使用这个库。

So I'm looking for a simple example of how to use this library in dart.

推荐答案

我对dart-protobuf不太熟悉, protobuf编译器和dart-protoc-plugin项目从一个原型定义生成你的Dart protobuf库。

I'm not too familiar with dart-protobuf, but it looks like you have to use the protobuf compiler and the dart-protoc-plugin project to generate your Dart protobuf library from a proto definition.

这里有一些说明:
https://github.com/dart-lang/dart-protoc-plugin

这篇关于如何使用dart-protobuf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆