desktop ordinals in wrap

This commit is contained in:
julian 2023-07-21 19:15:26 -06:00
parent c2df7ea113
commit 6c6c9c8325
2 changed files with 35 additions and 16 deletions

View file

@ -83,20 +83,36 @@ class _OrdinalsListState extends ConsumerState<OrdinalsList> {
);
}
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],
),
);
}
},
);
}

View file

@ -117,6 +117,7 @@ class _DesktopOrdinals extends ConsumerState<DesktopOrdinalsView> {
body: Padding(
padding: const EdgeInsets.all(24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
@ -230,8 +231,10 @@ class _DesktopOrdinals extends ConsumerState<DesktopOrdinalsView> {
height: 16,
),
Expanded(
child: OrdinalsList(
walletId: widget.walletId,
child: SingleChildScrollView(
child: OrdinalsList(
walletId: widget.walletId,
),
),
),
],