Visitar URL original
[pigeon] made support of array datatypes more complete by gaaclarke · Pull Request #202 · flutter/packages · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[pigeon] made the pigeon files support array datatypes more completely
  • Loading branch information
gaaclarke committed Sep 3, 2020
commit a2a56eaa6f8b93a3e8fed994328c2902b723a93c
5 changes: 5 additions & 0 deletions packages/pigeon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.1.5

* Made array datatypes correctly get imported and exported avoiding the need to
add extra imports to generated code.

## 0.1.4

* Fixed nullability for NSError's in generated objc code.
Expand Down
1 change: 1 addition & 0 deletions packages/pigeon/lib/dart_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ void generateDart(Root root, StringSink sink) {
'// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import');
indent.writeln('import \'dart:async\';');
indent.writeln('import \'package:flutter/services.dart\';');
indent.writeln('import \'dart:typed_data\' show Uint8List, Int32List, Int64List, Float64List;');
indent.writeln('');

for (Class klass in root.classes) {
Expand Down
1 change: 1 addition & 0 deletions packages/pigeon/lib/pigeon.dart
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export 'dart:typed_data' show Uint8List, Int32List, Int64List, Float64List;
export 'pigeon_lib.dart';
28 changes: 28 additions & 0 deletions packages/pigeon/pigeons/all_datatypes.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2020 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:pigeon/pigeon.dart';

class Everything {
bool aBool;
int anInt;
double aDouble;
String aString;
Uint8List aByteArray;
Int32List a4ByteArray;
Int64List a8ByteArray;
Float64List aFloatArray;
List aList;
Map aMap;
}

@HostApi()
abstract class HostEverything {
Everything giveMeEverything();
}

@FlutterApi()
abstract class FlutterEverything {
Everything giveMeEverything();
}
2 changes: 1 addition & 1 deletion packages/pigeon/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: pigeon
version: 0.1.4
version: 0.1.5
description: Code generator tool to make communication between Flutter and the host platform type-safe and easier.
homepage: https://github.com/flutter/packages/tree/master/packages/pigeon
dependencies:
Expand Down
6 changes: 3 additions & 3 deletions packages/pigeon/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ test_pigeon_ios() {
-o $temp_dir/pigeon.o

dartfmt -w $temp_dir/pigeon.dart
if [ -e "e2e_tests" ]; then
dartanalyzer $temp_dir/pigeon.dart --packages ./e2e_tests/test_objc/.packages
fi
dartanalyzer $temp_dir/pigeon.dart --packages ./e2e_tests/test_objc/.packages
rm -rf $temp_dir
}

Expand Down Expand Up @@ -92,13 +90,15 @@ test_pigeon_android ./pigeons/message.dart
test_pigeon_android ./pigeons/void_arg_host.dart
test_pigeon_android ./pigeons/void_arg_flutter.dart
test_pigeon_android ./pigeons/list.dart
test_pigeon_android ./pigeons/all_datatypes.dart
test_pigeon_ios ./pigeons/message.dart
test_pigeon_ios ./pigeons/host2flutter.dart
test_pigeon_ios ./pigeons/voidhost.dart
test_pigeon_ios ./pigeons/voidflutter.dart
test_pigeon_ios ./pigeons/void_arg_host.dart
test_pigeon_ios ./pigeons/void_arg_flutter.dart
test_pigeon_ios ./pigeons/list.dart
test_pigeon_ios ./pigeons/all_datatypes.dart

###############################################################################
# Mock handler flutter tests.
Expand Down