@@ -106,6 +106,7 @@ class PhotoViewGallery extends StatefulWidget {
106106 required this .pageOptions,
107107 this .loadingBuilder,
108108 this .backgroundDecoration,
109+ this .wantKeepAlive = false ,
109110 this .gaplessPlayback = false ,
110111 this .reverse = false ,
111112 this .pageController,
@@ -129,6 +130,7 @@ class PhotoViewGallery extends StatefulWidget {
129130 required this .builder,
130131 this .loadingBuilder,
131132 this .backgroundDecoration,
133+ this .wantKeepAlive = false ,
132134 this .gaplessPlayback = false ,
133135 this .reverse = false ,
134136 this .pageController,
@@ -162,6 +164,9 @@ class PhotoViewGallery extends StatefulWidget {
162164 /// Mirror to [PhotoView.backgroundDecoration]
163165 final BoxDecoration ? backgroundDecoration;
164166
167+ /// Mirror to [PhotoView.wantKeepAlive]
168+ final bool wantKeepAlive;
169+
165170 /// Mirror to [PhotoView.gaplessPlayback]
166171 final bool gaplessPlayback;
167172
@@ -246,6 +251,7 @@ class _PhotoViewGalleryState extends State<PhotoViewGallery> {
246251 child: pageOption.child,
247252 childSize: pageOption.childSize,
248253 backgroundDecoration: widget.backgroundDecoration,
254+ wantKeepAlive: widget.wantKeepAlive,
249255 controller: pageOption.controller,
250256 scaleStateController: pageOption.scaleStateController,
251257 customSize: widget.customSize,
@@ -270,6 +276,7 @@ class _PhotoViewGalleryState extends State<PhotoViewGallery> {
270276 imageProvider: pageOption.imageProvider,
271277 loadingBuilder: widget.loadingBuilder,
272278 backgroundDecoration: widget.backgroundDecoration,
279+ wantKeepAlive: widget.wantKeepAlive,
273280 controller: pageOption.controller,
274281 scaleStateController: pageOption.scaleStateController,
275282 customSize: widget.customSize,
0 commit comments