Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
GroovinChip committed Jul 3, 2023
1 parent cbc4b07 commit 8c42c58
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -657,26 +657,34 @@ PushButton(

## MacosSwitch

A switch is a visual toggle between two mutually exclusive states — on and off. A switch shows that it's on when the
accent color is visible and off when the switch appears colorless. [Learn more](https://developer.apple.com/design/human-interface-guidelines/macos/buttons/switches/)
A switch (also known as a toggle) is a control that offers a binary choice between two mutually exclusive states — on and off. A switch shows that it's on when the
accent color is visible and off when the switch appears colorless.

| On | Off |
| ------------------------------------------ | ------------------------------------------ |
| <img src="https://imgur.com/qK1VCVr.jpg"/> | <img src="https://imgur.com/IBh5jkz.jpg"/> |
The `ContolSize` enum can be passed to the `size` property to control the size of the switch. `MacosSwitch` supports the following
control sizes:
* `mini`
* `small`
* `regular`

| Off | On |
|--------------------------------------------|--------------------------------------------|
| <img src="https://imgur.com/NBeTMoZ.jpg"/> | <img src="https://imgur.com/SBfE0jf.jpg"/> |

Here's an example of how to create a basic toggle switch:

```dart
bool selected = false;
bool switchValue = false;
MacosSwitch(
value: selected,
value: switchValue,
onChanged: (value) {
setState(() => selected = value);
setState(() => switchValue = value);
},
),
```

Learn more about switches [here](https://developer.apple.com/design/human-interface-guidelines/toggles).

## MacosSegmentedControl

Displays one or more navigational tabs in a single horizontal group. Used by `MacosTabView` to navigate between the
Expand Down

0 comments on commit 8c42c58

Please sign in to comment.