Skip to content

Commit

Permalink
fix: minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Xazin committed Oct 20, 2024
1 parent a3e280c commit 20d6a23
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,11 @@ class _GalleryCardState extends State<GalleryCard> {
rowId: bloc.rowController.rowId,
),
child: RowCardContainer(
buildAccessoryWhen: () =>
!context.watch<CardBloc>().state.isEditing,
accessories: accessories ?? [],
openAccessory: (_) {
popoverController.show();
},
openAccessory: (_) => popoverController.show(),
onTap: (_) => widget.onTap(context),
child: Container(
clipBehavior: Clip.antiAlias,
constraints: const BoxConstraints(maxWidth: 200),
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
Expand Down Expand Up @@ -126,7 +123,17 @@ class _GalleryCardState extends State<GalleryCard> {
userProfile: widget.userProfile,
showDefaultCover: true,
),
..._makeCells(context, state.rowMeta, state.cells),
Padding(
padding: widget.styleConfiguration.cardPadding,
child: Column(
mainAxisSize: MainAxisSize.min,
children: _makeCells(
context,
state.rowMeta,
state.cells,
),
),
),
],
);
},
Expand All @@ -146,15 +153,12 @@ class _GalleryCardState extends State<GalleryCard> {
) {
return cells
.mapIndexed(
(int index, CellMeta cellMeta) => Padding(
padding: widget.styleConfiguration.cardPadding,
child: CardContentCell(
cellBuilder: widget.cellBuilder,
cellMeta: cellMeta,
rowMeta: rowMeta,
isTitle: index == 0,
styleMap: widget.styleConfiguration.cellStyleMap,
),
(int index, CellMeta cellMeta) => CardContentCell(
cellBuilder: widget.cellBuilder,
cellMeta: cellMeta,
rowMeta: rowMeta,
isTitle: index == 0,
styleMap: widget.styleConfiguration.cellStyleMap,
),
)
.toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class _GalleryContentState extends State<GalleryContent> {
itemCount < maxItemsPerRow ? itemCount : maxItemsPerRow;

// Calculate the width of each item in the current row configuration
// TODO: Refine behavior, without the 0.0...1 buffer, resizing can cause odd behavior
// Without the 0.0...1 buffer, resizing can cause odd behavior
final totalSpacing = (itemsPerRow - 1) * spacing + 0.000001;
double itemWidth = (maxWidth - totalSpacing) / itemsPerRow;
itemWidth = itemWidth.isFinite ? itemWidth : double.infinity;
Expand Down Expand Up @@ -195,7 +195,6 @@ class _GalleryContentState extends State<GalleryContent> {
viewId: widget.viewId,
rowCache: widget.controller.rowCache,
styleConfiguration: RowCardStyleConfiguration(
cardPadding: const EdgeInsets.all(4),
cellStyleMap: desktopBoardCardCellStyleMap(context),
),
onTap: (_) => _openCard(
Expand Down

0 comments on commit 20d6a23

Please sign in to comment.