On Flutter web, PdfViewer crashes with NoSuchMethodError: Null check operator used on a null value at pdf_viewer.dart:525 (_layout!.documentSize) when its LayoutBuilder fires with maxHeight <= 0 — e.g. during a route transition that briefly collapses the parent's height.
_updateLayout early-returns when viewSize.height <= 0 (per its comment, this exists to fix a blank PDF when restoring a window from minimize on Windows) and leaves _layout null, but build() then force-unwraps it on the same frame.
The text-selection branch (:547 in 2.2.24, :674 in 2.4.1) has the same _layout! unwrap.
Stack:
NoSuchMethodError: Null check operator used on a null value
at _PdfViewerState.build.<anonymous function>.<anonymous function>
(pdfrx-2.2.24/lib/src/widgets/pdf_viewer.dart:525:48)
On Flutter web,
PdfViewercrashes withNoSuchMethodError: Null check operator used on a null valueatpdf_viewer.dart:525(_layout!.documentSize) when itsLayoutBuilderfires withmaxHeight <= 0— e.g. during a route transition that briefly collapses the parent's height._updateLayoutearly-returns whenviewSize.height <= 0(per its comment, this exists to fix a blank PDF when restoring a window from minimize on Windows) and leaves_layoutnull, butbuild()then force-unwraps it on the same frame.The text-selection branch (
:547in 2.2.24,:674in 2.4.1) has the same_layout!unwrap.Stack: