Skip to content

Commit

Permalink
fix(snap-page): fix channel dropdown item height (#1474)
Browse files Browse the repository at this point in the history
  • Loading branch information
d-loose authored Oct 26, 2023
1 parent 1e005ae commit 7139795
Showing 1 changed file with 39 additions and 33 deletions.
72 changes: 39 additions & 33 deletions lib/src/snapd/snap_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ class _ChannelDropdown extends StatelessWidget {
MaterialStatePropertyAll(Size(_kChannelDropdownWidth, 200)),
visualDensity: VisualDensity(horizontal: 0, vertical: 0),
),
itemStyle: MenuItemButton.styleFrom(),
itemStyle: MenuItemButton.styleFrom(
maximumSize: const Size.fromHeight(100),
),
child: Text(
'${model.selectedChannel} ${model.availableChannels![model.selectedChannel]!.version}',
),
Expand All @@ -635,40 +637,44 @@ class _ChannelDropdownEntry extends StatelessWidget {
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
return DefaultTextStyle(
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
overflow: TextOverflow.ellipsis,
),
child: SizedBox(
width: _kChannelDropdownWidth - 24,
child: Row(
children: [
DefaultTextStyle.merge(
style: TextStyle(
color: Theme.of(context).hintColor,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Text(l10n.snapPageChannelLabel),
Text(l10n.snapPageVersionLabel),
Text(l10n.snapPagePublishedLabel),
],
),
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: DefaultTextStyle(
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
overflow: TextOverflow.ellipsis,
),
const SizedBox(width: 8),
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
channelEntry.key,
channelEntry.value.version,
DateFormat.yMd().format(channelEntry.value.releasedAt),
].map((e) => Text(e, maxLines: 1)).toList(),
child: SizedBox(
width: _kChannelDropdownWidth - 24,
child: Row(
children: [
DefaultTextStyle.merge(
style: TextStyle(
color: Theme.of(context).hintColor,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Text(l10n.snapPageChannelLabel),
Text(l10n.snapPageVersionLabel),
Text(l10n.snapPagePublishedLabel),
],
),
),
),
],
const SizedBox(width: 8),
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
channelEntry.key,
channelEntry.value.version,
DateFormat.yMd().format(channelEntry.value.releasedAt),
].map((e) => Text(e, maxLines: 1)).toList(),
),
),
],
),
),
),
);
Expand Down

0 comments on commit 7139795

Please sign in to comment.