binSaed / flutter_cached_pdfview

Enhanced PDF view for Flutter.
https://pub.dev/packages/flutter_cached_pdfview
MIT License
118 stars 67 forks source link

Night mode toggle doesn't work #28

Open mg7237 opened 3 years ago

mg7237 commented 3 years ago

Describe the bug I have a Flutter application where I am placing the PDF widget as a Saffold body. The Scaffold header has a Widget which toggles between Light and Dark mode of the app. So the toggle is working perfectly for all Widgets on the page except flutter_chached_view pdf. On change of toggle switch, I toggle a boolean variable value which is assigned to night mode property i.e. PDF(nighMode: _boolToggle)

So the application code calls set state on change in bool value which toggles night mode for all widgets but PDF doesn't toggle between the two modes. The file remains in the mode when the PDF widget was initiated and rendered for the first time. The user needs to go back to the previous page, change the theme and then open the pdf again to view the pdf as per the updated theme. To Reproduce

  1. Create a simple flutter Material widget with Scaffold and PDF widget is defined as the body of the scaffold.
  2. Create a floating action button which is supposed to toggle between the dark and light themes
  3. Toggle boolean variable onPress of the FAB and call setstate().
  4. Although the boolean variable value mapped to nightMode property of PDF widget is chaged, the PDF nightMode doesn't toggle between Light and Dark mode. The pdf view remains in line with the theme at first installation of the widget on page load.

Expected behaviour On change of nightMode boolean value, the PDF view should be updated to show as per the updated mode.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context NA

mg7237 commented 3 years ago

Please review the issue and advise if this is really a defect or maybe I am doing something wrong. If its a defect then also its fine but if it is not a defect then please advise how to fix this problem.

binSaed commented 3 years ago

please look to this issue because we use flutter_pdfview as a viewer https://github.com/endigo/flutter_pdfview/issues/74

mg7237 commented 3 years ago

Hello Abdelrahman,

Following up in regards to this issue. Please confirm if this is being looked into and what is the initial impression of the root cause and any potential solutions being considered.

Thanks, Manish