Fix page viewer incorrectly disposed

This commit is contained in:
Ming Ming 2023-05-31 00:48:58 +08:00
parent f34d56bae1
commit 705745f7fd

View file

@ -150,6 +150,7 @@ class _ViewerState extends State<Viewer>
child: CircularProgressIndicator(),
),
HorizontalPageViewer(
key: _pageViewerKey,
pageCount: _streamFilesView.length,
pageBuilder: (context, i) =>
_buildPage(context, i, originalBrightness),
@ -882,6 +883,8 @@ class _ViewerState extends State<Viewer>
late List<FileDescriptor> _streamFilesView;
bool _isStreamFilesCopy = false;
final _pageViewerKey = GlobalKey();
static const _viewportFraction = 1.05;
}