mirror of
https://github.com/flutter/packages.git
synced 2025-07-01 15:23:25 +08:00
started handling null correctly for setup methods in java (#155)
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
## 0.1.0-experimental.11
|
||||
|
||||
* Fixed setting an api to null in Java.
|
||||
|
||||
## 0.1.0-experimental.10
|
||||
|
||||
* Added support for void argument functions.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Autogenerated from Pigeon (v0.1.0-experimental.10), do not edit directly.
|
||||
// Autogenerated from Pigeon (v0.1.0-experimental.11), do not edit directly.
|
||||
// See also: https://pub.dev/packages/pigeon
|
||||
#import <Foundation/Foundation.h>
|
||||
@protocol FlutterBinaryMessenger;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Autogenerated from Pigeon (v0.1.0-experimental.10), do not edit directly.
|
||||
// Autogenerated from Pigeon (v0.1.0-experimental.11), do not edit directly.
|
||||
// See also: https://pub.dev/packages/pigeon
|
||||
#import "dartle.h"
|
||||
#import <Flutter/Flutter.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Autogenerated from Pigeon (v0.1.0-experimental.10), do not edit directly.
|
||||
// Autogenerated from Pigeon (v0.1.0-experimental.11), do not edit directly.
|
||||
// See also: https://pub.dev/packages/pigeon
|
||||
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import
|
||||
import 'dart:async';
|
||||
|
@ -8,7 +8,7 @@ import 'dart:mirrors';
|
||||
import 'ast.dart';
|
||||
|
||||
/// The current version of pigeon.
|
||||
const String pigeonVersion = '0.1.0-experimental.10';
|
||||
const String pigeonVersion = '0.1.0-experimental.11';
|
||||
|
||||
/// Read all the content from [stdin] to a String.
|
||||
String readStdin() {
|
||||
@ -64,12 +64,16 @@ class Indent {
|
||||
/// Scoped increase of the ident level. For the execution of [func] the
|
||||
/// indentation will be incremented.
|
||||
void scoped(String begin, String end, Function func) {
|
||||
if (begin != null) {
|
||||
_sink.write(begin + newline);
|
||||
}
|
||||
inc();
|
||||
func();
|
||||
dec();
|
||||
if (end != null) {
|
||||
_sink.write(str() + end + newline);
|
||||
}
|
||||
}
|
||||
|
||||
/// Add [str] with indentation and a newline.
|
||||
void writeln(String str) {
|
||||
|
@ -53,6 +53,8 @@ void _writeHostApi(Indent indent, Api api) {
|
||||
'new BasicMessageChannel<Object>(binaryMessenger, "$channelName", new StandardMessageCodec());');
|
||||
indent.dec();
|
||||
indent.dec();
|
||||
indent.write('if (api != null) ');
|
||||
indent.scoped('{', '} else {', () {
|
||||
indent.write(
|
||||
'channel.setMessageHandler(new BasicMessageChannel.MessageHandler<Object>() ');
|
||||
indent.scoped('{', '});', () {
|
||||
@ -92,6 +94,10 @@ void _writeHostApi(Indent indent, Api api) {
|
||||
});
|
||||
});
|
||||
});
|
||||
indent.scoped(null, '}', () {
|
||||
indent.writeln('channel.setMessageHandler(null);');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: pigeon
|
||||
version: 0.1.0-experimental.10
|
||||
version: 0.1.0-experimental.11
|
||||
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:
|
||||
|
@ -69,6 +69,7 @@ void main() {
|
||||
final String code = sink.toString();
|
||||
expect(code, contains('public interface Api'));
|
||||
expect(code, matches('Output.*doSomething.*Input'));
|
||||
expect(code, contains('channel.setMessageHandler(null)'));
|
||||
});
|
||||
|
||||
test('all the simple datatypes header', () {
|
||||
|
Reference in New Issue
Block a user