@@ -444,6 +444,7 @@ class VideoLightboxPage extends StatefulWidget {
444
444
445
445
class _VideoLightboxPageState extends State <VideoLightboxPage > with PerAccountStoreAwareStateMixin <VideoLightboxPage > {
446
446
VideoPlayerController ? _controller;
447
+ final TransformationController _transformationController = TransformationController ();
447
448
448
449
@override
449
450
void onNewStore () {
@@ -494,6 +495,7 @@ class _VideoLightboxPageState extends State<VideoLightboxPage> with PerAccountSt
494
495
_controller? .removeListener (_handleVideoControllerUpdate);
495
496
_controller? .dispose ();
496
497
_controller = null ;
498
+ _transformationController.dispose ();
497
499
// The VideoController doesn't emit a pause event
498
500
// while disposing, so disable the wakelock here
499
501
// explicitly.
@@ -546,21 +548,22 @@ class _VideoLightboxPageState extends State<VideoLightboxPage> with PerAccountSt
546
548
return _LightboxPageLayout (
547
549
routeEntranceAnimation: widget.routeEntranceAnimation,
548
550
message: widget.message,
549
- buildAppBarBottom: (context) => null ,
551
+ buildAppBarBottom: null ,
550
552
buildBottomAppBar: _buildBottomAppBar,
551
- child: SafeArea (
552
- child: Center (
553
- child: Stack (alignment: Alignment .center, children: [
554
- if (_controller != null && _controller! .value.isInitialized)
555
- AspectRatio (
553
+ child: _controller == null
554
+ ? const Center (child: CircularProgressIndicator ())
555
+ : Center (
556
+ child: InteractiveViewer (
557
+ transformationController: _transformationController,
558
+ minScale: 1.0 ,
559
+ maxScale: 5.0 ,
560
+ child: AspectRatio (
556
561
aspectRatio: _controller! .value.aspectRatio,
557
- child: VideoPlayer (_controller! )),
558
- if (_controller == null || ! _controller! .value.isInitialized || _controller! .value.isBuffering)
559
- const SizedBox (
560
- width: 32 ,
561
- height: 32 ,
562
- child: CircularProgressIndicator (color: Colors .white)),
563
- ]))));
562
+ child: VideoPlayer (_controller! ),
563
+ ),
564
+ ),
565
+ ),
566
+ );
564
567
}
565
568
}
566
569
0 commit comments