Skip to content

Commit

Permalink
fix: Add spacing between primary button and the rest in SnapPage (#1812)
Browse files Browse the repository at this point in the history
  • Loading branch information
spydon authored Sep 6, 2024
2 parents 5c4aa8b + 24e3215 commit ed99ab1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
5 changes: 4 additions & 1 deletion packages/app_center/lib/layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ import 'package:flutter/material.dart';

const kMargin = 4.0;
const kCardMargin = 4.0;
const kCardSpacing = 16.0;
const kPaneWidth = 204.0;
const kPagePadding = 24.0;
const kCardSpacing = 16.0;
const kSpacingSmall = 8.0;
const kSpacing = 16.0;
const kSearchBarWidth = 424.0 - 2 * kCardMargin;
const kIconSize = 56.0;
const kSectionSpacing = 48.0;

const kCardSizeNormal = Size(416.0, 170.0);
const kCardSizeWide = Size(548.0, 170.0);
Expand Down
17 changes: 11 additions & 6 deletions packages/app_center/lib/snapd/snap_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:app_center/constants.dart';
import 'package:app_center/error/error.dart';
import 'package:app_center/extensions/iterable_extensions.dart';
import 'package:app_center/extensions/string_extensions.dart';
import 'package:app_center/l10n.dart';
import 'package:app_center/layout.dart';
Expand Down Expand Up @@ -173,7 +174,7 @@ class _SnapView extends StatelessWidget {
if (snapData.availableChannels != null &&
snapData.selectedChannel != null) ...[
_ChannelDropdown(snapData: snapData),
const SizedBox(width: 16),
const SizedBox(width: kSpacing),
],
Flexible(
child: _SnapActionButtons(snapData: snapData),
Expand All @@ -191,7 +192,7 @@ class _SnapView extends StatelessWidget {
),
),
const Divider(),
const SizedBox(height: 48),
const SizedBox(height: kSectionSpacing),
if (snapData.hasGallery) ...[
AppPageSection(
header: Text(
Expand All @@ -202,7 +203,9 @@ class _SnapView extends StatelessWidget {
?.copyWith(fontWeight: FontWeight.w500),
),
child: Padding(
padding: const EdgeInsets.only(bottom: 48),
padding: const EdgeInsets.only(
bottom: kSectionSpacing,
),
child: ScreenshotGallery(
title: snapData.storeSnap!.titleOrName,
urls: snapData.storeSnap!.screenshotUrls,
Expand All @@ -211,7 +214,7 @@ class _SnapView extends StatelessWidget {
),
),
const Divider(),
const SizedBox(height: 48),
const SizedBox(height: kSectionSpacing),
],
AppPageSection(
header: Text(
Expand Down Expand Up @@ -392,12 +395,14 @@ class _SnapActionButtons extends ConsumerWidget {
else if (snapData.isInstalled)
secondaryActionsButton,
if (snapData.isInstalled) ...[
const SizedBox(width: 8),
_RatingsActionButtons(
snap: snapData.snap,
),
],
].whereNotNull().toList(),
]
.whereNotNull()
.toList()
.separatedBy(const SizedBox(width: kSpacingSmall)),
);
}
}
Expand Down

0 comments on commit ed99ab1

Please sign in to comment.