Visitar URL original
[pigeon] Improve java generation by matejdro · Pull Request #214 · flutter/packages · GitHub
Skip to content
Merged
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
Prev Previous commit
Next Next commit
[pigeon] allow call of the flutter api method without the callback
  • Loading branch information
matejdro authored and gaaclarke committed Mar 1, 2021
commit 2fe4b9fbf04b8819617117a2a0c4fe5078e3474d
13 changes: 13 additions & 0 deletions packages/pigeon/lib/java_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,19 @@ void _writeFlutterApi(Indent indent, Api api) {
indent.writeln('channel.send($sendArgument, null);');
});
});

if (func.argType == 'void') {
indent.write('public void ${func.name}() ');
} else {
indent.write('public void ${func.name}(${func.argType} argInput) ');
}
indent.scoped('{', '}', () {
if (func.argType == 'void') {
indent.writeln('${func.name}(null);');
} else {
indent.writeln('${func.name}(argInput, null);');
}
});
}
});
}
Expand Down