Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## [1.5.0]
* Adds `endSidebar` to `MacosWindow`

## [1.4.2]
* Fixes RenderFlex overflowed in `MacosListTile` [#264](https://github.com/GroovinChip/macos_ui/issues/264)
* Fixes RenderFlex overflowed in `MacosListTile` [#264](https://github.com/GroovinChip/macos_ui/issues/264)

## [1.4.1+1]
* Update `pubspec.yaml` with `repository` and new `homepage` field.
Expand Down
11 changes: 11 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,17 @@ class _WidgetGalleryState extends State<WidgetGallery> {
subtitle: Text('[email protected]'),
),
),
endSidebar: Sidebar(
startWidth: 200,
minWidth: 200,
maxWidth: 300,
shownByDefault: false,
builder: (context, scrollController) {
return const Center(
child: Text('End Sidebar'),
);
},
),
child: IndexedStack(
index: pageIndex,
children: pages,
Expand Down
28 changes: 25 additions & 3 deletions example/lib/pages/buttons_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,35 @@ class _ButtonsPageState extends State<ButtonsPage> {
toolBar: ToolBar(
title: const Text('Buttons'),
titleWidth: 150.0,
leading: MacosTooltip(
message: 'Toggle Sidebar',
useMousePosition: false,
child: MacosIconButton(
icon: MacosIcon(
CupertinoIcons.sidebar_left,
color: MacosTheme.brightnessOf(context).resolve(
const Color.fromRGBO(0, 0, 0, 0.5),
const Color.fromRGBO(255, 255, 255, 0.5),
),
size: 20.0,
),
boxConstraints: const BoxConstraints(
minHeight: 20,
minWidth: 20,
maxWidth: 48,
maxHeight: 38,
),
onPressed: () => MacosWindowScope.of(context).toggleSidebar(),
),
),
actions: [
ToolBarIconButton(
label: 'Toggle Sidebar',
label: 'Toggle End Sidebar',
tooltipMessage: 'Toggle End Sidebar',
icon: const MacosIcon(
CupertinoIcons.sidebar_left,
CupertinoIcons.sidebar_right,
),
onPressed: () => MacosWindowScope.of(context).toggleSidebar(),
onPressed: () => MacosWindowScope.of(context).toggleEndSidebar(),
showLabel: false,
),
],
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.4.1+1"
version: "1.5.0"
matcher:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/buttons/icon_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class MacosIconButtonState extends State<MacosIconButton>
vsync: this,
);
_opacityAnimation = _animationController
.drive(CurveTween(curve: Curves.decelerate))
.drive(CurveTween(curve: const Interval(0.0, 0.25)))
.drive(_opacityTween);
_setTween();
}
Expand Down
8 changes: 8 additions & 0 deletions lib/src/layout/sidebar/sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Sidebar {
this.top,
this.bottom,
this.topOffset = 51.0,
this.shownByDefault = true,
}) : dragClosedBuffer = dragClosedBuffer ?? minWidth / 2;

/// The builder that creates a child to display in this widget, which will
Expand Down Expand Up @@ -111,4 +112,11 @@ class Sidebar {
///
/// Defaults to `51.0` which levels it up with the default height of the [TitleBar]
final double topOffset;

/// Whether the sidebar should be open by default or not.
///
/// Most useful for end sidebars.
///
/// Defaults to `true`.
final bool shownByDefault;
}
Loading