Skip to content

Commit 098c22f

Browse files
authored
fix: Correct the placement of the leading widget in disclosure sidebar items (#272)
1 parent 9b8f75d commit 098c22f

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [1.5.1]
2+
* Correct the placement of the leading widget in disclosure sidebar items [#268](https://github.com/GroovinChip/macos_ui/issues/268)
3+
14
## [1.5.0]
25
* Adds `endSidebar` to `MacosWindow`
36

example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ class _WidgetGalleryState extends State<WidgetGallery> {
188188
label: Text('Fields'),
189189
),
190190
SidebarItem(
191+
leading: Icon(CupertinoIcons.folder),
191192
label: Text('Disclosure'),
192193
disclosureItems: [
193194
SidebarItem(

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ packages:
8787
path: ".."
8888
relative: true
8989
source: path
90-
version: "1.5.0"
90+
version: "1.5.1"
9191
matcher:
9292
dependency: transitive
9393
description:

lib/src/layout/sidebar/sidebar_items.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,20 +338,21 @@ class __DisclosureSidebarItemState extends State<_DisclosureSidebarItem>
338338
label: widget.item.label,
339339
leading: Row(
340340
children: [
341-
if (widget.item.leading != null)
342-
Padding(
343-
padding: EdgeInsets.only(right: spacing),
344-
child: widget.item.leading!,
345-
),
346341
RotationTransition(
347342
turns: _iconTurns,
348343
child: Icon(
349344
CupertinoIcons.chevron_right,
345+
size: 12.0,
350346
color: theme.brightness == Brightness.light
351347
? MacosColors.black
352348
: MacosColors.white,
353349
),
354350
),
351+
if (widget.item.leading != null)
352+
Padding(
353+
padding: EdgeInsets.only(left: spacing),
354+
child: widget.item.leading!,
355+
),
355356
],
356357
),
357358
unselectedColor: MacosColors.transparent,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: macos_ui
22
description: Flutter widgets and themes implementing the current macOS design language.
3-
version: 1.5.0
3+
version: 1.5.1
44
homepage: "https://macosui.dev"
55
repository: "https://github.com/GroovinChip/macos_ui"
66

0 commit comments

Comments
 (0)