From 6c6c9c832516ea55bc5fab1ce7b486df6838d1a8 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 21 Jul 2023 19:15:26 -0600 Subject: [PATCH] desktop ordinals in wrap --- lib/pages/ordinals/widgets/ordinals_list.dart | 44 +++++++++++++------ .../ordinals/desktop_ordinals_view.dart | 7 ++- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/lib/pages/ordinals/widgets/ordinals_list.dart b/lib/pages/ordinals/widgets/ordinals_list.dart index 8244416b9..481b0ef0a 100644 --- a/lib/pages/ordinals/widgets/ordinals_list.dart +++ b/lib/pages/ordinals/widgets/ordinals_list.dart @@ -83,20 +83,36 @@ class _OrdinalsListState extends ConsumerState { ); } - return GridView.builder( - shrinkWrap: true, - itemCount: _data.length, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisSpacing: _spacing, - mainAxisSpacing: _spacing, - crossAxisCount: Util.isDesktop ? 4 : 2, - childAspectRatio: 6 / 7, // was 3/4, less data displayed now - ), - itemBuilder: (_, i) => OrdinalCard( - walletId: widget.walletId, - ordinal: _data[i], - ), - ); + if (Util.isDesktop) { + return Wrap( + spacing: _spacing, + runSpacing: _spacing, + children: _data + .map((e) => SizedBox( + width: 220, + height: 270, + child: OrdinalCard( + walletId: widget.walletId, + ordinal: e, + ))) + .toList(), + ); + } else { + return GridView.builder( + shrinkWrap: true, + itemCount: _data.length, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisSpacing: _spacing, + mainAxisSpacing: _spacing, + crossAxisCount: Util.isDesktop ? 4 : 2, + childAspectRatio: 6 / 7, // was 3/4, less data displayed now + ), + itemBuilder: (_, i) => OrdinalCard( + walletId: widget.walletId, + ordinal: _data[i], + ), + ); + } }, ); } diff --git a/lib/pages_desktop_specific/ordinals/desktop_ordinals_view.dart b/lib/pages_desktop_specific/ordinals/desktop_ordinals_view.dart index 9d4742db7..414ece75d 100644 --- a/lib/pages_desktop_specific/ordinals/desktop_ordinals_view.dart +++ b/lib/pages_desktop_specific/ordinals/desktop_ordinals_view.dart @@ -117,6 +117,7 @@ class _DesktopOrdinals extends ConsumerState { body: Padding( padding: const EdgeInsets.all(24), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ @@ -230,8 +231,10 @@ class _DesktopOrdinals extends ConsumerState { height: 16, ), Expanded( - child: OrdinalsList( - walletId: widget.walletId, + child: SingleChildScrollView( + child: OrdinalsList( + walletId: widget.walletId, + ), ), ), ],