Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.6.0 - MacosTabView & MacosSegmentedControl #273

Merged
merged 18 commits into from
Jul 9, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [1.6.0]
* New widgets: `MacosTabView` and `MacosTabView`
* BREAKING CHANGE: `Label.yAxis` has been renamed to `Label.crossAxisAlignment`
* BREAKING CHANGE: `TooltipTheme` and `TooltipThemeData` have been renamed to `MacosTooltipTheme` and
`MacosTooltipThemeData`

## [1.5.1]
* Correct the placement of the leading widget in disclosure sidebar items [#268](https://github.com/GroovinChip/macos_ui/issues/268)
* Improve the sizing of the disclosure item indicator
Expand Down
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Guides, codelabs, and other documentation can be found at https://macosui.dev
- [Modern Window Look](#modern-window-look)
- [ToolBar](#toolbar)
- [MacosListTile](#MacosListTile)
- [MacosTabView](#MacosTabView)
</details>

<details>
Expand All @@ -55,6 +56,7 @@ Guides, codelabs, and other documentation can be found at https://macosui.dev
- [PopupButton](#popupbutton)
- [PushButton](#pushbutton)
- [MacosSwitch](#macosswitch)
- [MacosSegmentedControl](#macossegmentedcontrol)
</details>

<details>
Expand Down Expand Up @@ -354,7 +356,49 @@ MacosListTile(
),
```

## MacosTabView
A multipage interface that displays one page at a time. Must be used in a `StatefulWidget`.

<img src="https://imgur.com/Mdn7Li2.png"/>

You can control the placement of the tabs using the `position` property.

Usage:
```dart
final _controller = MacosTabController(
initialIndex: 0,
length: 3,
);

...

MacosTabView(
controller: _controller,
tabs: const [
MacosTab(
label: 'Tab 1',
),
MacosTab(
label: 'Tab 2',
),
MacosTab(
label: 'Tab 3',
),
],
children: const [
Center(
child: Text('Tab 1'),
),
Center(
child: Text('Tab 2'),
),
Center(
child: Text('Tab 3'),
),
],
),

```

# Icons

Expand Down Expand Up @@ -584,6 +628,16 @@ MacosSwitch(
),
```

## MacosSegmentedControl

Displays one or more navigational tabs in a single horizontal group. Used by `MacosTabView` to navigate between the
different tabs of the tab bar.

<img src="https://imgur.com/Igvms1w.jpg"/>

The typical usage of this widget is by `MacosTabView`, to control the navigation of its children. You do not need to
specify a `MacosSegmentedControl` with your `MacosTabView`, as it is built by that widget.

# Dialogs and Sheets

## MacosAlertDialog
Expand Down
6 changes: 6 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:example/pages/dialogs_page.dart';
import 'package:example/pages/fields_page.dart';
import 'package:example/pages/indicators_page.dart';
import 'package:example/pages/selectors_page.dart';
import 'package:example/pages/tabview_page.dart';
import 'package:example/pages/toolbar_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:macos_ui/macos_ui.dart';
Expand Down Expand Up @@ -68,6 +69,7 @@ class _WidgetGalleryState extends State<WidgetGallery> {
const DialogsPage(),
const ToolbarPage(),
const SelectorsPage(),
const TabViewPage(),
];

@override
Expand Down Expand Up @@ -213,6 +215,10 @@ class _WidgetGalleryState extends State<WidgetGallery> {
leading: MacosIcon(CupertinoIcons.calendar),
label: Text('Selectors'),
),
SidebarItem(
leading: MacosIcon(CupertinoIcons.table_fill),
label: Text('TabView'),
),
],
);
},
Expand Down