SfPdfViewer throws error when used inside a nested Navigator #2366
Labels
pdf viewer
PDF viewer component
waiting for customer response
Cannot make further progress until the customer responds.
Uh oh!
There was an error while loading. Please reload this page.
Hi Syncfusion team,
I'm encountering an issue when wrapping SfPdfViewer.memory inside a nested Navigator. When I try to use built-in features like page navigation, I consistently receive the following error:
Failed assertion: line 5646 pos 12: '_history.isNotEmpty': is not true.
Here's a simplified version of the code:
Navigator( key: navigationPossKey, onGenerateInitialRoutes: (navigatorState, initialRoute) { return [ MaterialPageRoute( builder: (context) => Builder( builder: (context) { return SfPdfViewer.memory( _pdfBytes!, ); }, ), ) ]; }, )
I suspect the internal use of Navigator within the PDF viewer is conflicting with the custom navigation context created by the nested Navigator. This causes the internal history stack to behave unexpectedly or break altogether.
Would it be possible to improve support for nested navigators or expose some options to disable internal navigation behavior? Alternatively, is there a recommended approach for using SfPdfViewer inside a tab/page structure with a nested navigator?
Thanks in advance!
The text was updated successfully, but these errors were encountered: