pdftron-flutter icon indicating copy to clipboard operation
pdftron-flutter copied to clipboard

`await controller.openDocument()` is not being waited on

Open dcupidon opened this issue 3 years ago • 0 comments

Describe the bug Other DocumentViewController methods are running before openDocument() finishes even though the await keyword is being used. When debugging with Android Studio, I realized that onTabDocumentLoaded was not being called after openDocument.

Steps to Reproduce the Problem

  1. Use example/lib/main.dart and uncomment the code needed to use the widget view.
  2. In onDocumentViewCreated place any method call after await controller.openDocument(_document, config: config);, where _document = "https://pdftron.s3.amazonaws.com/downloads/pl/PDFTRON_mobile_about.pdf"
  3. Run app

Expected behavior The document would have opened as normal and the methods called would have ran in order.

Screenshots Call stack: Screen Shot 2021-07-09 at 12 29 16 PM

Platform/Device Information (please complete the following information if applicable):

  • Platform: Android
  • Device: Pixel 3a
  • OS: Android 11

dcupidon avatar Jul 09 '21 19:07 dcupidon