From 7fd07e6102d17b9a894c2fa9a8172227b2f334c3 Mon Sep 17 00:00:00 2001 From: GroovinChip Date: Fri, 1 Jul 2022 12:08:04 -0400 Subject: [PATCH] fix: Correct the placement of the leading widget in disclosure sidebar items --- CHANGELOG.md | 3 +++ example/lib/main.dart | 1 + example/pubspec.lock | 2 +- lib/src/layout/sidebar/sidebar_items.dart | 11 ++++++----- pubspec.yaml | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b19a3aa1..2a087973 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/example/lib/main.dart b/example/lib/main.dart index 29c401ef..e12ac6d1 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -188,6 +188,7 @@ class _WidgetGalleryState extends State { label: Text('Fields'), ), SidebarItem( + leading: Icon(CupertinoIcons.folder), label: Text('Disclosure'), disclosureItems: [ SidebarItem( diff --git a/example/pubspec.lock b/example/pubspec.lock index f652e649..a5c70a7e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -87,7 +87,7 @@ packages: path: ".." relative: true source: path - version: "1.5.0" + version: "1.5.1" matcher: dependency: transitive description: diff --git a/lib/src/layout/sidebar/sidebar_items.dart b/lib/src/layout/sidebar/sidebar_items.dart index ffd788d9..e05ddb07 100644 --- a/lib/src/layout/sidebar/sidebar_items.dart +++ b/lib/src/layout/sidebar/sidebar_items.dart @@ -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, diff --git a/pubspec.yaml b/pubspec.yaml index 66ec750a..ed1c8632 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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"