Fix nav button sometimes lead to a wrong page

This commit is contained in:
Ming Ming 2021-08-10 19:04:33 +08:00
parent 52b063211f
commit 8bd586fc4a

View file

@ -106,6 +106,7 @@ class _HorizontalPageViewerState extends State<HorizontalPageViewer> {
return [
if (_canSwitchRight)
Align(
key: ValueKey(0),
alignment: Alignment.centerRight,
child: Material(
type: MaterialType.transparency,
@ -143,6 +144,7 @@ class _HorizontalPageViewerState extends State<HorizontalPageViewer> {
),
if (_canSwitchLeft)
Align(
key: ValueKey(1),
alignment: Alignment.centerLeft,
child: Material(
type: MaterialType.transparency,