-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectp: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Description
I had IDL with
@FlutterApi()
abstract class FlutterBookApi {
void displayBookDetails(Book book);
}it created Java code
public interface Reply<T> {
void reply(T reply);
}
public void displayBookDetails(Book argInput, Reply<Void> callback) {
BasicMessageChannel<Object> channel =
new BasicMessageChannel<Object>(binaryMessenger, "dev.flutter.pigeon.FlutterBookApi.displayBookDetails", new StandardMessageCodec());
HashMap inputMap = argInput.toMap();
channel.send(inputMap, new BasicMessageChannel.Reply<Object>() {
public void reply(Object channelReply) {
callback.reply(null);
}
});
}but if I don't care about the result, I can't pass null to callback since it doesn't null check and can crash.
cc @gaaclarke
matejdro, martinsellergren and Jon-Salmon
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectp: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team