You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Documentation about checkbox
* Documentation about radio button
* Documentation about push button
* Documentation about toggle switch
* Documentation about indicators
* Documentation about help buttons
A checkbox is a type of button that lets the user choose between two opposite states, actions, or values. A selected checkbox is considered on when it contains a checkmark and off when it's empty. A checkbox is almost always followed by a title unless it appears in a checklist. [Learn more](https://developer.apple.com/design/human-interface-guidelines/macos/buttons/checkboxes/)
Here's an example of how to create a basic checkbox:
62
+
63
+
```dart
64
+
bool selected = false;
65
+
66
+
Checkbox(
67
+
value: selected,
68
+
onChanged: (value) {
69
+
setState(() => selected = value);
70
+
},
71
+
)
72
+
```
73
+
74
+
To make a checkbox in the `mixed` state, set `value` to `null`.
75
+
76
+
## HelpButton
77
+
78
+
A help button appears within a view and opens app-specific help documentation when clicked. All help buttons are circular, consistently sized buttons that contain a question mark icon. [Learn more](https://developer.apple.com/design/human-interface-guidelines/macos/buttons/help-buttons/)
You can customize the help button appearance and behaviour using the `HelpButtonTheme`, but it's not recommended by apple to change help button's appearance.
A radio button is a small, circular button followed by a title. Typically presented in groups of two to five, radio buttons provide the user a set of related but mutually exclusive choices. A radio button’s state is either on (a filled circle) or off (an empty circle). [Learn more](https://developer.apple.com/design/human-interface-guidelines/macos/buttons/radio-buttons/)
Here's an example of how to create a basic radio button:
101
+
102
+
```dart
103
+
bool selected = false;
104
+
105
+
RadioButton(
106
+
value: selected,
107
+
onChanged: (value) {
108
+
setState(() => selected = value);
109
+
},
110
+
),
111
+
```
53
112
54
113
## PushButton
55
114
56
-
<imgsrc="https://imgur.com/v99ekWA.jpg"/>
57
-
<imgsrc="https://imgur.com/GsShoF6.jpg"/>
58
-
<imgsrc="https://imgur.com/TgfjJdQ.jpg"/>
59
-
<imgsrc="https://imgur.com/wt0K6u4.jpg"/>
60
-
<imgsrc="https://imgur.com/hj6uGhI.jpg"/>
61
-
<imgsrc="https://imgur.com/klWHTAX.jpg"/>
62
-
<imgsrc="https://imgur.com/83cEMeP.jpg"/>
63
-
<imgsrc="https://imgur.com/7khWnwt.jpg"/>
115
+
A push button appears within a view and initiates an instantaneous app-specific action, such as printing a document or deleting a file. Push buttons contain text—not icons—and often open a separate window, dialog, or app so the user can complete a task. [Learn more](https://developer.apple.com/design/human-interface-guidelines/macos/buttons/push-buttons/)
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/)
Here's an example of how to create a basic toggle switch:
145
+
146
+
```dart
147
+
bool selected = false;
148
+
149
+
Switch(
150
+
value: selected,
151
+
onChanged: (value) {
152
+
setState(() => selected = value);
153
+
},
154
+
),
155
+
```
69
156
70
157
# Indicators
71
158
72
-
## ProgressCircle
159
+
## Progress Indicators
160
+
161
+
Don’t make people sit around staring at a static screen waiting for your app to load content or perform lengthy data processing operations. Use progress indicators to let people know your app hasn't stalled and to give them some idea of how long they’ll be waiting.
162
+
163
+
Progress indicators have two distinct styles:
164
+
165
+
-**Bar indicators**, more commonly known as progress bars, show progress in a horizontal bar.
166
+
-**Spinning indicators** show progress in a circular form, either as a spinner or as a circle that fills in as progress continues.
73
167
74
-
A `ProgressCircle` can be either determinate or indeterminate. If indeterminate, Flutter's
75
-
`CupertinoActivityIndicator` will be shown.
168
+
People don't interact with progress indicators; however, they are often accompanied by a button for canceling the corresponding operation. [Learn more](https://developer.apple.com/design/human-interface-guidelines/macos/indicators/progress-indicators/)
Here's an example of how to create a determinate progress bar:
197
+
198
+
```dart
199
+
ProgressBar(
200
+
value: 30,
201
+
)
202
+
```
203
+
204
+
## Level Indicators
205
+
206
+
A level indicator graphically represents of a specific value within a range of numeric values. It’s similar to a [slider](#slider) in purpose, but more visual and doesn’t contain a distinct control for selecting a value—clicking and dragging across the level indicator itself to select a value is supported, however. A level indicator can also include tick marks, making it easy for the user to pinpoint a specific value in the range. There are three different level indicator styles, each with a different appearance, for communicating capacity, rating, and relevance.
207
+
208
+
### CapacityIndicator
209
+
210
+
A capacity indicator illustrates the current level in relation to a finite capacity. Capacity indicators are often used when communicating factors like disk and battery usage. [Learn more](https://developer.apple.com/design/human-interface-guidelines/macos/indicators/level-indicators#capacity-indicators)
| A horizontal translucent track that fills with a colored bar to indicate the current value. Tick marks are often displayed to provide context. | A horizontal row of separate, equally sized, rectangular segments. The number of segments matches the total capacity, and the segments fill completely—never partially—with color to indicate the current value. |
216
+
217
+
Here's an example of how to create an interactive continuous capacity indicator:
218
+
219
+
```dart
220
+
double value = 30;
221
+
222
+
CapacityIndicator(
223
+
value: value,
224
+
discrete: false,
225
+
onChanged: (v) {
226
+
setState(() => value = v);
227
+
},
228
+
),
229
+
```
230
+
231
+
You can set `discrete` to `true` to make it a discrete capacity indicator.
232
+
233
+
### RatingIndicator
234
+
235
+
A rating indicator uses a series of horizontally arranged graphical symbols to communicate a ranking level. The default symbol is a star.
A rating indicator doesn’t display partial symbols—its value is rounded in order to display complete symbols only. Within a rating indicator, symbols are always the same distance apart and don't expand or shrink to fit the control. [Learn more](https://developer.apple.com/design/human-interface-guidelines/macos/indicators/level-indicators#rating-indicators)
240
+
241
+
Here's an example of how to create an interactive rating indicator:
242
+
243
+
```dart
244
+
double value = 3;
245
+
246
+
RatingIndicator(
247
+
amount: 5,
248
+
value: value,
249
+
onChanged: (v) {
250
+
setState(() => value = v);
251
+
}
252
+
)
253
+
```
254
+
255
+
### RelevanceIndicator
256
+
257
+
A relevance indicator communicates relevancy using a series of vertical bars. It often appears in a list of search results for reference when sorting and comparing multiple items. [Learn more](https://developer.apple.com/design/human-interface-guidelines/macos/indicators/level-indicators#relevance-indicators)
0 commit comments