Skip to content
Closed
Changes from all commits
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
8 changes: 4 additions & 4 deletions pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class PDFInfoAppState extends State<PDFInfoApp> {
pdfs.add(item.path);
} else if (isDir) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the example app shows all of directories even if the app aims to show the summary of pdf files found in $HOME directory. I thought better to exclude directories and included only pdf files.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't created this example so I don't know what has been the purpose of this. I'm fine with not removing these lines as it doesn't make the example non-functional.

Feel free to open another PR that deletes this line (and cleans the unused variables as a result of your change) that explains why you are making this change. I'd rather this PR remains focused on solving the bug that you fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed another changes to follow up your PR comments. Please review again.

dirs.add(item.path);
}
}
setState(() {
_isLoading = false;
Expand Down Expand Up @@ -158,9 +157,10 @@ class PDFFileInfo {
// Since java.io is not directly available, use package:jni API to
// create a java.io.File object.
final fileClass = JClass.forName("java/io/File");
final inputFile = fileClass
.constructorId("(Ljava/lang/String;)V")
.call(fileClass, JObject.type, [filename]);
final fileConstructor = fileClass.constructorId("(Ljava/lang/String;)V");
final inputFile = fileConstructor(
fileClass, JObject.type, [JString.fromString(filename)]);

// Static method call PDDocument.load -> PDDocument
final pdf = PDDocument.load(inputFile)!;
// Instance method call getNumberOfPages() -> int
Expand Down