diff --git a/lib/widgets/attachment/attachment_list.dart b/lib/widgets/attachment/attachment_list.dart index ff1b0d8..9e8d145 100644 --- a/lib/widgets/attachment/attachment_list.dart +++ b/lib/widgets/attachment/attachment_list.dart @@ -196,72 +196,68 @@ class _AttachmentListState extends State { ); } - return AspectRatio( - aspectRatio: widget.data.isNotEmpty ? widget.data.first?.data['ratio']?.toDouble() ?? 1 : 1, - child: Container( - constraints: constraints, - child: ScrollConfiguration( - behavior: _AttachmentListScrollBehavior(), - child: ListView.separated( - padding: widget.padding, - shrinkWrap: true, - itemCount: widget.data.length, - itemBuilder: (context, idx) { - return Container( - constraints: constraints.copyWith(maxWidth: widget.maxWidth), - child: AspectRatio( - aspectRatio: (widget.data[idx]?.data['ratio'] ?? 1).toDouble(), - child: GestureDetector( - onTap: () { - if (widget.data[idx]?.mediaType != SnMediaType.image) return; - context.pushTransparentRoute( - AttachmentZoomView( - data: - widget.data.where((ele) => ele != null && ele.mediaType == SnMediaType.image).cast(), - initialIndex: idx, - heroTags: heroTags, - ), - backgroundColor: Colors.black.withOpacity(0.7), - rootNavigator: true, - ); - }, - child: Stack( - fit: StackFit.expand, - children: [ - Container( - decoration: BoxDecoration( - color: backgroundColor, - border: Border( - top: borderSide, - bottom: borderSide, - ), - borderRadius: AttachmentList.kDefaultRadius, + return Container( + constraints: BoxConstraints(maxHeight: constraints.maxHeight), + child: ScrollConfiguration( + behavior: _AttachmentListScrollBehavior(), + child: ListView.separated( + padding: widget.padding, + shrinkWrap: true, + itemCount: widget.data.length, + itemBuilder: (context, idx) { + return Container( + constraints: constraints.copyWith(maxWidth: widget.maxWidth), + child: AspectRatio( + aspectRatio: (widget.data[idx]?.data['ratio'] ?? 1).toDouble(), + child: GestureDetector( + onTap: () { + if (widget.data[idx]?.mediaType != SnMediaType.image) return; + context.pushTransparentRoute( + AttachmentZoomView( + data: widget.data.where((ele) => ele != null && ele.mediaType == SnMediaType.image).cast(), + initialIndex: idx, + heroTags: heroTags, + ), + backgroundColor: Colors.black.withOpacity(0.7), + rootNavigator: true, + ); + }, + child: Stack( + fit: StackFit.expand, + children: [ + Container( + decoration: BoxDecoration( + color: backgroundColor, + border: Border( + top: borderSide, + bottom: borderSide, ), - child: ClipRRect( - borderRadius: AttachmentList.kDefaultRadius, - child: AttachmentItem( - data: widget.data[idx], - heroTag: heroTags[idx], - ), + borderRadius: AttachmentList.kDefaultRadius, + ), + child: ClipRRect( + borderRadius: AttachmentList.kDefaultRadius, + child: AttachmentItem( + data: widget.data[idx], + heroTag: heroTags[idx], ), ), - Positioned( - right: 8, - bottom: 8, - child: Chip( - label: Text('${idx + 1}/${widget.data.length}'), - ), + ), + Positioned( + right: 8, + bottom: 8, + child: Chip( + label: Text('${idx + 1}/${widget.data.length}'), ), - ], - ), + ), + ], ), ), - ); - }, - separatorBuilder: (context, index) => const Gap(8), - physics: const BouncingScrollPhysics(), - scrollDirection: Axis.horizontal, - ), + ), + ); + }, + separatorBuilder: (context, index) => const Gap(8), + physics: const BouncingScrollPhysics(), + scrollDirection: Axis.horizontal, ), ), ); diff --git a/lib/widgets/navigation/app_scaffold.dart b/lib/widgets/navigation/app_scaffold.dart index 9044e93..0fa799f 100644 --- a/lib/widgets/navigation/app_scaffold.dart +++ b/lib/widgets/navigation/app_scaffold.dart @@ -110,31 +110,28 @@ class AppRootScaffold extends StatelessWidget { Column( children: [ if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 1 / devicePixelRatio, + WindowTitleBarBox( + child: Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 1 / devicePixelRatio, + ), ), ), - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: Platform.isMacOS ? MainAxisAlignment.center : MainAxisAlignment.start, - children: [ - WindowTitleBarBox( - child: MoveWindow( - child: Text( + child: MoveWindow( + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: Platform.isMacOS ? MainAxisAlignment.center : MainAxisAlignment.start, + children: [ + Text( 'Solar Network', style: GoogleFonts.spaceGrotesk(), ).padding(horizontal: 12, vertical: 5), - ), - ), - if (!Platform.isMacOS) - Expanded( - child: WindowTitleBarBox( - child: Row( + if (!Platform.isMacOS) + Row( + mainAxisSize: MainAxisSize.min, children: [ Expanded(child: MoveWindow()), Row( @@ -146,9 +143,9 @@ class AppRootScaffold extends StatelessWidget { ), ], ), - ), - ), - ], + ], + ), + ), ), ), Expanded(child: innerWidget),