Skip to content

Commit

Permalink
fix: Correct the placement of the leading widget in disclosure sideba…
Browse files Browse the repository at this point in the history
…r items (#272)
  • Loading branch information
GroovinChip authored Jul 1, 2022
1 parent 9b8f75d commit 098c22f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [1.5.1]
* Correct the placement of the leading widget in disclosure sidebar items [#268](https://github.com/GroovinChip/macos_ui/issues/268)

## [1.5.0]
* Adds `endSidebar` to `MacosWindow`

Expand Down
1 change: 1 addition & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ class _WidgetGalleryState extends State<WidgetGallery> {
label: Text('Fields'),
),
SidebarItem(
leading: Icon(CupertinoIcons.folder),
label: Text('Disclosure'),
disclosureItems: [
SidebarItem(
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.5.0"
version: "1.5.1"
matcher:
dependency: transitive
description:
Expand Down
11 changes: 6 additions & 5 deletions lib/src/layout/sidebar/sidebar_items.dart
Original file line number Diff line number Diff line change
Expand Up @@ -338,20 +338,21 @@ class __DisclosureSidebarItemState extends State<_DisclosureSidebarItem>
label: widget.item.label,
leading: Row(
children: [
if (widget.item.leading != null)
Padding(
padding: EdgeInsets.only(right: spacing),
child: widget.item.leading!,
),
RotationTransition(
turns: _iconTurns,
child: Icon(
CupertinoIcons.chevron_right,
size: 12.0,
color: theme.brightness == Brightness.light
? MacosColors.black
: MacosColors.white,
),
),
if (widget.item.leading != null)
Padding(
padding: EdgeInsets.only(left: spacing),
child: widget.item.leading!,
),
],
),
unselectedColor: MacosColors.transparent,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: macos_ui
description: Flutter widgets and themes implementing the current macOS design language.
version: 1.5.0
version: 1.5.1
homepage: "https://macosui.dev"
repository: "https://github.com/GroovinChip/macos_ui"

Expand Down

0 comments on commit 098c22f

Please sign in to comment.