Skip to content

view_pdf_file example added #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 6, 2020
Merged

view_pdf_file example added #57

merged 6 commits into from
Oct 6, 2020

Conversation

tsvillain
Copy link
Contributor

@nisrulz
Copy link
Owner

nisrulz commented Sep 30, 2020

Thank you for your contribution. I will validate this first and then comment if it works :)

@tsvillain
Copy link
Contributor Author

Thank you for your contribution. I will validate this first and then comment if it works :)

Okay No Issues

@nisrulz
Copy link
Owner

nisrulz commented Oct 1, 2020

@tsvillain I took a look at your PR and noted few changes that would make this example app's PR complete:

  1. Adding an entry in the readme with a link like other apps.
  2. I noticed this PR sets up the app to use a URL to download the pdf and the display it.
  • First you should use pdf url from something that will exist forever. I see the url you use can be removed in future. A good way to do is to create a simple "Hello Flutter" pdf file on your own and add it to the repo. Then use the github api to download that file. That way it is always available via the repo itself.
  • It is good practice to store the URL as a separate variable at the top of the file/function, somewhere it is easy to find when scanning code.
  1. An ability to load local pdf file from a assets directory within the app. That way you are covering both usecases i.e local file loading while also covering remote file loading via a URL. Within the app, that would mean that you now have 2 buttons at the beginning "Load PDF via URL" and "Load local PDF". When user clicks one, all buttons are hidden and progress shows up and then you load the file.

  2. When the progress is showing, then the raised button shouldn't be visible. Right now it is showing up.

@tsvillain
Copy link
Contributor Author

Okay will make the required changes.

@tsvillain
Copy link
Contributor Author

tsvillain commented Oct 2, 2020

@nisrulz the package you have recommended to use does not allow to load pdf from the asset. Can I use another package that can load from the asset as well as the URL?
Can I use this: https://pub.dev/packages/advance_pdf_viewer

@nisrulz
Copy link
Owner

nisrulz commented Oct 2, 2020

Yes, definitely. When I created the related issue, back then maybe this other package was not present.

But the idea was to cover both usecases. Switch the lib to support both usecase.

Thank you for bringing it up. :)

@nisrulz nisrulz self-requested a review October 2, 2020 09:01
@tsvillain
Copy link
Contributor Author

Yes, definitely. When I created the related issue, back then maybe this other package was not present.

But the idea was to cover both usecases. Switch the lib to support both usecase.

Thank you for bringing it up. :)

Thanks for the confirmation will update this PR in few hours.

changed package, example of both load pdf from asset and url, added link from example in readme
@tsvillain
Copy link
Contributor Author

@nisrulz in load from URL, I am loading the pdf that is in the assets folder using the full URL.

  • Some changes have to be made before merging the PR like we have to update the branch from URL present in Constants.dart
  • Currently for testing I have added a URL from the web.
    I didn't get who to get the repo's single file download link using GitHub API. If you know that then let me know who to implement using that.

@nisrulz
Copy link
Owner

nisrulz commented Oct 5, 2020

I will add the code for you to start using the github based asset url. Give me some time. The PR looks good otherwise.

@nisrulz nisrulz assigned nisrulz and unassigned tsvillain Oct 5, 2020
Copy link
Owner

@nisrulz nisrulz left a comment

Choose a reason for hiding this comment

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

Awesome work @tsvillain 🎉 Your PR was the only one that has not required me to ask for a lot of changes. Really good work here.

Some minor comments for you to address. Then this PR is ready to be merged.

@tsvillain tsvillain requested a review from nisrulz October 6, 2020 07:24
@nisrulz
Copy link
Owner

nisrulz commented Oct 6, 2020

Good work @tsvillain 🌮 This looks good now. Thank you for your contribution 😸

Make sure to check other issues if your want contribute more 😄

@nisrulz nisrulz merged commit 24955ae into nisrulz:develop Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants