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
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.7

* Fixed Dart compilation for later versions that support null safety, opting out
of it for now.

## 0.1.6

* Fixed unused variable linter warning in Dart code under certain conditions.
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 @@ -138,6 +138,7 @@ void generateDart(Root root, StringSink sink) {
indent.writeln(
'import \'dart:typed_data\' show Uint8List, Int32List, Int64List, Float64List;');
indent.writeln('');
indent.writeln('// @dart = 2.8');

for (Class klass in root.classes) {
sink.write('class ${klass.name} ');
Expand Down
2 changes: 1 addition & 1 deletion packages/pigeon/lib/generator_tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'dart:mirrors';
import 'ast.dart';

/// The current version of pigeon.
const String pigeonVersion = '0.1.6';
const String pigeonVersion = '0.1.7';

/// Read all the content from [stdin] to a String.
String readStdin() {
Expand Down
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.6
version: 0.1.7
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
17 changes: 17 additions & 0 deletions packages/pigeon/test/dart_generator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,21 @@ void main() {
expect(code, matches('\'${Keys.result}\': output._toMap()'));
expect(code, contains('return <dynamic, dynamic>{};'));
});

test('opt out of nndb', () {
final Class klass = Class()
..name = 'Foobar'
..fields = <Field>[
Field()
..name = 'field1'
..dataType = 'dataType1'
];
final Root root = Root()
..apis = <Api>[]
..classes = <Class>[klass];
final StringBuffer sink = StringBuffer();
generateDart(root, sink);
final String code = sink.toString();
expect(code, contains('// @dart = 2.8'));
});
}