-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e01a8d
commit b2474aa
Showing
14 changed files
with
275 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// Generated code. Do not modify. | ||
// source: test_pet.proto | ||
// | ||
// @dart = 2.12 | ||
|
||
// ignore_for_file: annotate_overrides, camel_case_types | ||
// ignore_for_file: constant_identifier_names, library_prefixes | ||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields | ||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import | ||
|
||
import 'dart:core' as $core; | ||
|
||
import 'package:protobuf/protobuf.dart' as $pb; | ||
|
||
class Pet extends $pb.GeneratedMessage { | ||
factory Pet() => create(); | ||
Pet._() : super(); | ||
factory Pet.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); | ||
factory Pet.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); | ||
|
||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Pet', package: const $pb.PackageName(_omitMessageNames ? '' : 'com.pet'), createEmptyInstance: create) | ||
..aOS(1, _omitFieldNames ? '' : 'name') | ||
..hasRequiredFields = false | ||
; | ||
|
||
@$core.Deprecated( | ||
'Using this can add significant overhead to your binary. ' | ||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' | ||
'Will be removed in next major version') | ||
Pet clone() => Pet()..mergeFromMessage(this); | ||
@$core.Deprecated( | ||
'Using this can add significant overhead to your binary. ' | ||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' | ||
'Will be removed in next major version') | ||
Pet copyWith(void Function(Pet) updates) => super.copyWith((message) => updates(message as Pet)) as Pet; | ||
|
||
$pb.BuilderInfo get info_ => _i; | ||
|
||
@$core.pragma('dart2js:noInline') | ||
static Pet create() => Pet._(); | ||
Pet createEmptyInstance() => create(); | ||
static $pb.PbList<Pet> createRepeated() => $pb.PbList<Pet>(); | ||
@$core.pragma('dart2js:noInline') | ||
static Pet getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Pet>(create); | ||
static Pet? _defaultInstance; | ||
|
||
@$pb.TagNumber(1) | ||
$core.String get name => $_getSZ(0); | ||
@$pb.TagNumber(1) | ||
set name($core.String v) { $_setString(0, v); } | ||
@$pb.TagNumber(1) | ||
$core.bool hasName() => $_has(0); | ||
@$pb.TagNumber(1) | ||
void clearName() => clearField(1); | ||
} | ||
|
||
|
||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); | ||
const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Generated code. Do not modify. | ||
// source: test_pet.proto | ||
// | ||
// @dart = 2.12 | ||
|
||
// ignore_for_file: annotate_overrides, camel_case_types | ||
// ignore_for_file: constant_identifier_names, library_prefixes | ||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields | ||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import | ||
|
||
import 'dart:convert' as $convert; | ||
import 'dart:core' as $core; | ||
import 'dart:typed_data' as $typed_data; | ||
|
||
@$core.Deprecated('Use petDescriptor instead') | ||
const Pet$json = { | ||
'1': 'Pet', | ||
'2': [ | ||
{'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, | ||
], | ||
}; | ||
|
||
/// Descriptor for `Pet`. Decode as a `google.protobuf.DescriptorProto`. | ||
final $typed_data.Uint8List petDescriptor = $convert.base64Decode( | ||
'CgNQZXQSEgoEbmFtZRgBIAEoCVIEbmFtZQ=='); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
syntax = "proto3"; | ||
|
||
package com.pet; | ||
|
||
message Pet { | ||
string name = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
migrate_working_dir/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. | ||
/pubspec.lock | ||
**/doc/api/ | ||
.dart_tool/ | ||
.packages | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 | ||
channel: stable | ||
|
||
project_type: package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 0.0.1 | ||
|
||
* Initial Release of ProtobufMessageAdapter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TODO: Add your license here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!-- | ||
This README describes the package. If you publish this package to pub.dev, | ||
this README's contents appear on the landing page for your package. | ||
For information about how to write a good package README, see the guide for | ||
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages). | ||
For general information about developing packages, see the Dart guide for | ||
[creating packages](https://dart.dev/guides/libraries/create-library-packages) | ||
and the Flutter guide for | ||
[developing packages and plugins](https://flutter.dev/developing-packages). | ||
--> | ||
|
||
TODO: Put a short description of the package here that helps potential users | ||
know whether this package might be useful for them. | ||
|
||
## Features | ||
|
||
TODO: List what your package can do. Maybe include images, gifs, or videos. | ||
|
||
## Getting started | ||
|
||
TODO: List prerequisites and provide or point to information on how to | ||
start using the package. | ||
|
||
## Usage | ||
|
||
TODO: Include short and useful examples for package users. Add longer examples | ||
to `/example` folder. | ||
|
||
```dart | ||
const like = 'sample'; | ||
``` | ||
|
||
## Additional information | ||
|
||
TODO: Tell users more about the package: where to find more information, how to | ||
contribute to the package, how to file issues, what response they can expect | ||
from the package authors, and more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'dart:typed_data'; | ||
|
||
import 'package:courier_dart_sdk/message_adapter/message_adapter.dart'; | ||
import 'package:protobuf/protobuf.dart'; | ||
|
||
class ProtobufMessageAdapter extends MessageAdapter { | ||
const ProtobufMessageAdapter(); | ||
|
||
@override | ||
String contentType() => "application/x-protobuf"; | ||
|
||
@override | ||
T decode<T>(Uint8List bytes, dynamic decoder) => decoder(bytes); | ||
|
||
@override | ||
Uint8List encode(Object object, String topic, dynamic encoder) { | ||
if (object is GeneratedMessage) { | ||
return object.writeToBuffer(); | ||
} | ||
throw Exception( | ||
'${object.runtimeType} is not of type protobuf generated message'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: courier_protobuf | ||
description: A new Flutter package project. | ||
version: 0.0.1 | ||
homepage: | ||
|
||
environment: | ||
sdk: ">=2.12.0 <4.0.0" | ||
flutter: ">=1.17.0" | ||
|
||
dependencies: | ||
flutter: | ||
sdk: flutter | ||
courier_dart_sdk: 0.0.9 | ||
protobuf: ^2.0.1 | ||
|
||
dev_dependencies: | ||
flutter_test: | ||
sdk: flutter | ||
flutter_lints: ^2.0.0 | ||
|
||
flutter: |