@@ -317,73 +317,70 @@ class _FullScreenMediaDesktopState extends State<FullScreenMediaDesktop> {
317317 return ValueListenableBuilder (
318318 valueListenable: _isDisplayingDetail,
319319 builder: (context, isDisplayingDetail, child) {
320+ final padding = MediaQuery .paddingOf (context);
321+
320322 return AnimatedContainer (
321323 duration: kThemeChangeDuration,
322- color: isDisplayingDetail
323- ? StreamChannelHeaderTheme .of (context).color
324- : Colors .black,
325- child: Builder (
326- builder: (context) {
327- if (attachment.type == AttachmentType .image ||
328- attachment.type == AttachmentType .giphy) {
329- return PhotoView .customChild (
330- maxScale: PhotoViewComputedScale .covered,
331- minScale: PhotoViewComputedScale .contained,
332- backgroundDecoration: const BoxDecoration (
333- color: Colors .transparent,
334- ),
335- child: StreamMediaAttachmentThumbnail (
336- media: attachment,
337- width: double .infinity,
338- height: double .infinity,
339- ),
340- );
341- } else if (attachment.type == AttachmentType .video) {
342- final package = videoPackages[attachment.id]! ;
343- if (package.attachment.assetUrl != null ) {
344- package.player.open (
345- Playlist (
346- [
347- Media (package.attachment.assetUrl! ),
348- ],
349- ),
350- play: widget.autoplayVideos,
351- );
352- }
353-
354- final mediaQuery = MediaQuery .of (context);
355- final bottomPadding = mediaQuery.padding.bottom;
356-
357- return AnimatedPadding (
358- duration: kThemeChangeDuration,
359- padding: EdgeInsets .symmetric (
360- vertical: isDisplayingDetail
361- ? kToolbarHeight + bottomPadding
362- : 0 ,
363- ),
364- child: ContextMenuRegion (
365- contextMenuBuilder: (_, anchor) {
366- return ContextMenu (
367- anchor: anchor,
368- menuItems: [
369- DownloadMenuItem (
370- attachment: attachment,
371- ),
372- ],
373- );
374- },
375- child: Video (
376- controller: package.controller,
377- ),
378- ),
379- );
380- }
381-
382- return const Empty ();
383- },
324+ color: switch (isDisplayingDetail) {
325+ true => StreamChannelHeaderTheme .of (context).color,
326+ false => Colors .black,
327+ },
328+ padding: EdgeInsetsDirectional .only (
329+ top: padding.top + kToolbarHeight,
330+ bottom: padding.bottom + kToolbarHeight,
384331 ),
332+ child: child,
385333 );
386334 },
335+ child: Builder (
336+ builder: (context) {
337+ if (attachment.type == AttachmentType .image ||
338+ attachment.type == AttachmentType .giphy) {
339+ return PhotoView .customChild (
340+ maxScale: PhotoViewComputedScale .covered,
341+ minScale: PhotoViewComputedScale .contained,
342+ backgroundDecoration: const BoxDecoration (
343+ color: Colors .transparent,
344+ ),
345+ child: StreamMediaAttachmentThumbnail (
346+ media: attachment,
347+ width: double .infinity,
348+ height: double .infinity,
349+ ),
350+ );
351+ } else if (attachment.type == AttachmentType .video) {
352+ final package = videoPackages[attachment.id]! ;
353+ if (package.attachment.assetUrl != null ) {
354+ package.player.open (
355+ Playlist (
356+ [
357+ Media (package.attachment.assetUrl! ),
358+ ],
359+ ),
360+ play: widget.autoplayVideos,
361+ );
362+ }
363+
364+ return ContextMenuRegion (
365+ contextMenuBuilder: (_, anchor) {
366+ return ContextMenu (
367+ anchor: anchor,
368+ menuItems: [
369+ DownloadMenuItem (
370+ attachment: attachment,
371+ ),
372+ ],
373+ );
374+ },
375+ child: Video (
376+ controller: package.controller,
377+ ),
378+ );
379+ }
380+
381+ return const Empty ();
382+ },
383+ ),
387384 );
388385 },
389386 ),
0 commit comments