flet 0.70.0.dev5623__py3-none-any.whl → 0.70.0.dev5774__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of flet might be problematic. Click here for more details.
- flet/__init__.py +2 -0
- flet/controls/adaptive_control.py +16 -13
- flet/controls/base_page.py +5 -5
- flet/controls/border.py +4 -3
- flet/controls/box.py +6 -11
- flet/controls/buttons.py +7 -7
- flet/controls/context.py +2 -2
- flet/controls/control.py +18 -11
- flet/controls/core/animated_switcher.py +9 -13
- flet/controls/core/canvas/canvas.py +1 -1
- flet/controls/core/canvas/line.py +2 -3
- flet/controls/core/canvas/oval.py +1 -1
- flet/controls/core/canvas/shape.py +10 -10
- flet/controls/core/canvas/text.py +1 -1
- flet/controls/core/column.py +5 -5
- flet/controls/core/dismissible.py +8 -8
- flet/controls/core/drag_target.py +5 -4
- flet/controls/core/draggable.py +19 -14
- flet/controls/core/grid_view.py +2 -2
- flet/controls/core/image.py +1 -1
- flet/controls/core/interactive_viewer.py +2 -2
- flet/controls/core/list_view.py +7 -7
- flet/controls/core/markdown.py +1 -1
- flet/controls/core/pagelet.py +10 -10
- flet/controls/core/reorderable_draggable.py +1 -1
- flet/controls/core/responsive_row.py +7 -7
- flet/controls/core/row.py +8 -8
- flet/controls/core/semantics.py +9 -6
- flet/controls/core/shader_mask.py +3 -3
- flet/controls/core/stack.py +4 -4
- flet/controls/core/text.py +7 -7
- flet/controls/core/text_span.py +4 -4
- flet/controls/core/transparent_pointer.py +3 -3
- flet/controls/core/view.py +16 -16
- flet/controls/core/window.py +1 -1
- flet/controls/core/window_drag_area.py +1 -1
- flet/controls/cupertino/cupertino_action_sheet.py +19 -8
- flet/controls/cupertino/cupertino_activity_indicator.py +5 -6
- flet/controls/cupertino/cupertino_alert_dialog.py +7 -10
- flet/controls/cupertino/cupertino_app_bar.py +34 -34
- flet/controls/cupertino/cupertino_bottom_sheet.py +5 -5
- flet/controls/cupertino/cupertino_button.py +4 -4
- flet/controls/cupertino/cupertino_checkbox.py +33 -40
- flet/controls/cupertino/cupertino_context_menu.py +7 -6
- flet/controls/cupertino/cupertino_context_menu_action.py +2 -4
- flet/controls/cupertino/cupertino_date_picker.py +35 -37
- flet/controls/cupertino/cupertino_dialog_action.py +12 -9
- flet/controls/cupertino/cupertino_list_tile.py +24 -36
- flet/controls/cupertino/cupertino_navigation_bar.py +10 -11
- flet/controls/cupertino/cupertino_picker.py +11 -10
- flet/controls/cupertino/cupertino_radio.py +10 -13
- flet/controls/cupertino/cupertino_segmented_button.py +9 -12
- flet/controls/cupertino/cupertino_slider.py +6 -9
- flet/controls/cupertino/cupertino_sliding_segmented_button.py +14 -17
- flet/controls/cupertino/cupertino_switch.py +30 -41
- flet/controls/cupertino/cupertino_textfield.py +14 -18
- flet/controls/cupertino/cupertino_timer_picker.py +11 -8
- flet/controls/exceptions.py +5 -5
- flet/controls/icon_data.py +2 -2
- flet/controls/keys.py +2 -1
- flet/controls/layout_control.py +22 -27
- flet/controls/material/alert_dialog.py +44 -50
- flet/controls/material/app_bar.py +41 -45
- flet/controls/material/auto_complete.py +10 -8
- flet/controls/material/badge.py +32 -28
- flet/controls/material/banner.py +14 -14
- flet/controls/material/bottom_app_bar.py +7 -9
- flet/controls/material/bottom_sheet.py +10 -10
- flet/controls/material/button.py +2 -24
- flet/controls/material/card.py +10 -11
- flet/controls/material/checkbox.py +41 -49
- flet/controls/material/chip.py +44 -47
- flet/controls/material/circle_avatar.py +19 -22
- flet/controls/material/container.py +16 -123
- flet/controls/material/datatable.py +71 -95
- flet/controls/material/date_picker.py +13 -14
- flet/controls/material/date_range_picker.py +183 -0
- flet/controls/material/divider.py +24 -23
- flet/controls/material/dropdown.py +13 -13
- flet/controls/material/expansion_tile.py +5 -6
- flet/controls/material/filled_button.py +1 -1
- flet/controls/material/floating_action_button.py +2 -2
- flet/controls/material/form_field_control.py +64 -56
- flet/controls/material/icon_button.py +29 -65
- flet/controls/material/list_tile.py +25 -23
- flet/controls/material/menu_item_button.py +2 -2
- flet/controls/material/navigation_bar.py +3 -3
- flet/controls/material/navigation_rail.py +11 -11
- flet/controls/material/outlined_button.py +1 -1
- flet/controls/material/popup_menu_button.py +3 -3
- flet/controls/material/progress_bar.py +15 -22
- flet/controls/material/progress_ring.py +8 -8
- flet/controls/material/radio.py +3 -8
- flet/controls/material/range_slider.py +1 -1
- flet/controls/material/search_bar.py +15 -16
- flet/controls/material/segmented_button.py +4 -4
- flet/controls/material/selection_area.py +4 -3
- flet/controls/material/slider.py +16 -16
- flet/controls/material/snack_bar.py +33 -32
- flet/controls/material/submenu_button.py +9 -9
- flet/controls/material/switch.py +13 -13
- flet/controls/material/tabs.py +77 -78
- flet/controls/material/text_button.py +2 -2
- flet/controls/material/textfield.py +4 -6
- flet/controls/material/tooltip.py +16 -15
- flet/controls/material/vertical_divider.py +10 -10
- flet/controls/page.py +4 -4
- flet/controls/painting.py +2 -2
- flet/controls/scrollable_control.py +1 -1
- flet/controls/services/file_picker.py +7 -7
- flet/controls/services/haptic_feedback.py +1 -1
- flet/controls/services/shake_detector.py +1 -1
- flet/controls/services/storage_paths.py +3 -3
- flet/controls/text_style.py +1 -1
- flet/controls/theme.py +611 -609
- flet/controls/types.py +11 -11
- flet/testing/finder.py +2 -0
- flet/testing/flet_test_app.py +6 -4
- flet/version.py +1 -1
- {flet-0.70.0.dev5623.dist-info → flet-0.70.0.dev5774.dist-info}/METADATA +5 -5
- flet-0.70.0.dev5774.dist-info/RECORD +239 -0
- flet-0.70.0.dev5623.dist-info/RECORD +0 -238
- {flet-0.70.0.dev5623.dist-info → flet-0.70.0.dev5774.dist-info}/WHEEL +0 -0
- {flet-0.70.0.dev5623.dist-info → flet-0.70.0.dev5774.dist-info}/entry_points.txt +0 -0
- {flet-0.70.0.dev5623.dist-info → flet-0.70.0.dev5774.dist-info}/top_level.txt +0 -0
|
@@ -33,7 +33,7 @@ class FormFieldControl(LayoutControl):
|
|
|
33
33
|
|
|
34
34
|
text_style: TextStyle = field(default_factory=lambda: TextStyle())
|
|
35
35
|
"""
|
|
36
|
-
The [`TextStyle`][flet.
|
|
36
|
+
The [`TextStyle`][flet.] to use for the
|
|
37
37
|
text being edited.
|
|
38
38
|
"""
|
|
39
39
|
|
|
@@ -42,7 +42,7 @@ class FormFieldControl(LayoutControl):
|
|
|
42
42
|
Defines how the text should be aligned vertically.
|
|
43
43
|
|
|
44
44
|
Value can either be a number ranging from `-1.0` (topmost location) to `1.0`
|
|
45
|
-
(bottommost location) or of type [`VerticalAlignment`][flet.
|
|
45
|
+
(bottommost location) or of type [`VerticalAlignment`][flet.]
|
|
46
46
|
Defaults to `VerticalAlignment.CENTER`.
|
|
47
47
|
"""
|
|
48
48
|
|
|
@@ -59,8 +59,7 @@ class FormFieldControl(LayoutControl):
|
|
|
59
59
|
|
|
60
60
|
label_style: Optional[TextStyle] = None
|
|
61
61
|
"""
|
|
62
|
-
The
|
|
63
|
-
`label`.
|
|
62
|
+
The text style to use for `label`.
|
|
64
63
|
"""
|
|
65
64
|
|
|
66
65
|
icon: Optional[IconDataOrControl] = None
|
|
@@ -80,8 +79,10 @@ class FormFieldControl(LayoutControl):
|
|
|
80
79
|
|
|
81
80
|
bgcolor: Optional[ColorValue] = None
|
|
82
81
|
"""
|
|
83
|
-
TextField background color.
|
|
84
|
-
|
|
82
|
+
TextField background color.
|
|
83
|
+
|
|
84
|
+
Note:
|
|
85
|
+
Will not be visible if [`filled`][flet.FormFieldControl.] is `False`.
|
|
85
86
|
"""
|
|
86
87
|
|
|
87
88
|
border_radius: Optional[BorderRadiusValue] = None
|
|
@@ -90,27 +91,33 @@ class FormFieldControl(LayoutControl):
|
|
|
90
91
|
|
|
91
92
|
border_width: Optional[Number] = None
|
|
92
93
|
"""
|
|
93
|
-
The width of the border in virtual pixels.
|
|
94
|
-
border.
|
|
94
|
+
The width of the border in virtual pixels.
|
|
95
95
|
|
|
96
96
|
Defaults to `1`.
|
|
97
|
+
|
|
98
|
+
Tip:
|
|
99
|
+
Set to `0` to completely remove the border.
|
|
97
100
|
"""
|
|
98
101
|
|
|
99
102
|
border_color: Optional[ColorValue] = None
|
|
100
103
|
"""
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
The border color.
|
|
105
|
+
|
|
106
|
+
Tip:
|
|
107
|
+
Set to [`Colors.TRANSPARENT`][flet.] to invisible/hide the border.
|
|
103
108
|
"""
|
|
104
109
|
|
|
105
110
|
focused_color: Optional[ColorValue] = None
|
|
106
111
|
"""
|
|
107
|
-
|
|
112
|
+
The text's color when focused.
|
|
108
113
|
"""
|
|
109
114
|
|
|
110
115
|
focused_bgcolor: Optional[ColorValue] = None
|
|
111
116
|
"""
|
|
112
|
-
Background color
|
|
113
|
-
|
|
117
|
+
Background color in focused state.
|
|
118
|
+
|
|
119
|
+
Note:
|
|
120
|
+
Will not be visible if [`filled`][flet.FormFieldControl.] is `False`.
|
|
114
121
|
"""
|
|
115
122
|
|
|
116
123
|
focused_border_width: Optional[Number] = None
|
|
@@ -130,22 +137,26 @@ class FormFieldControl(LayoutControl):
|
|
|
130
137
|
|
|
131
138
|
dense: Optional[bool] = None
|
|
132
139
|
"""
|
|
133
|
-
Whether
|
|
140
|
+
Whether this control is part of a dense form (ie, uses less vertical space).
|
|
134
141
|
"""
|
|
135
142
|
|
|
136
143
|
filled: Optional[bool] = None
|
|
137
144
|
"""
|
|
138
|
-
If `True` the decoration's container is filled with theme
|
|
145
|
+
If `True` the decoration's container is filled with theme
|
|
146
|
+
[`fill_color`][flet.FormFieldControl.].
|
|
139
147
|
|
|
140
|
-
If `filled=None`(default), then it is implicitly set to `True` when at least
|
|
141
|
-
the following is not `None`: `fill_color
|
|
142
|
-
`
|
|
148
|
+
If `filled=None` (the default), then it is implicitly set to `True` when at least
|
|
149
|
+
one of the following is not `None`: [`fill_color`][flet.FormFieldControl.],
|
|
150
|
+
[`focused_bgcolor`][flet.FormFieldControl.],
|
|
151
|
+
[`hover_color`][flet.FormFieldControl.] and [`bgcolor`][flet.FormFieldControl.].
|
|
143
152
|
"""
|
|
144
153
|
|
|
145
154
|
fill_color: Optional[ColorValue] = None
|
|
146
155
|
"""
|
|
147
|
-
Background color of TextField.
|
|
148
|
-
|
|
156
|
+
Background color of TextField.
|
|
157
|
+
|
|
158
|
+
Note:
|
|
159
|
+
Will not be visible if [`filled`][flet.FormFieldControl.] is `False`.
|
|
149
160
|
"""
|
|
150
161
|
|
|
151
162
|
focus_color: Optional[ColorValue] = None
|
|
@@ -160,22 +171,23 @@ class FormFieldControl(LayoutControl):
|
|
|
160
171
|
|
|
161
172
|
hover_color: Optional[ColorValue] = None
|
|
162
173
|
"""
|
|
163
|
-
Background color of TextField when
|
|
164
|
-
|
|
174
|
+
Background color of TextField when hovered.
|
|
175
|
+
|
|
176
|
+
Note:
|
|
177
|
+
Will not be visible if [`filled`][flet.FormFieldControl.] is `False`.
|
|
165
178
|
"""
|
|
166
179
|
|
|
167
180
|
hint_text: Optional[str] = None
|
|
168
181
|
"""
|
|
169
182
|
Text that suggests what sort of input the field accepts.
|
|
170
183
|
|
|
171
|
-
Displayed on top of the input when the it's empty and either
|
|
172
|
-
(b) the input has the focus.
|
|
184
|
+
Displayed on top of the input when the it's empty and either
|
|
185
|
+
(a) [`label`][flet.FormFieldControl.] is `None` or (b) the input has the focus.
|
|
173
186
|
"""
|
|
174
187
|
|
|
175
188
|
hint_style: Optional[TextStyle] = None
|
|
176
189
|
"""
|
|
177
|
-
The [`
|
|
178
|
-
`hint_text`.
|
|
190
|
+
The text style to use for [`hint_text`][flet.FormFieldControl.].
|
|
179
191
|
"""
|
|
180
192
|
|
|
181
193
|
hint_fade_duration: Optional[DurationValue] = None
|
|
@@ -194,14 +206,14 @@ class FormFieldControl(LayoutControl):
|
|
|
194
206
|
used.
|
|
195
207
|
|
|
196
208
|
If non-null, the text is displayed below the input decorator, in the same location
|
|
197
|
-
as `
|
|
198
|
-
is not
|
|
209
|
+
as [`error`][flet.FormFieldControl.]. If a non-null
|
|
210
|
+
[`error`][flet.FormFieldControl.] value is specified then the helper text is not
|
|
211
|
+
shown.
|
|
199
212
|
"""
|
|
200
213
|
|
|
201
214
|
helper_style: Optional[TextStyle] = None
|
|
202
215
|
"""
|
|
203
|
-
The [`
|
|
204
|
-
`helper_text`.
|
|
216
|
+
The text style to use for [`helper`][flet.FormFieldControl.].
|
|
205
217
|
"""
|
|
206
218
|
|
|
207
219
|
helper_max_lines: Optional[int] = None
|
|
@@ -213,27 +225,25 @@ class FormFieldControl(LayoutControl):
|
|
|
213
225
|
"""
|
|
214
226
|
A `Control` to place below the line as a character count.
|
|
215
227
|
|
|
216
|
-
If `None` or an empty string
|
|
217
|
-
appear in the counter's location.
|
|
228
|
+
If `None` or an empty string then nothing will appear in the counter's location.
|
|
218
229
|
"""
|
|
219
230
|
|
|
220
231
|
counter_style: Optional[TextStyle] = None
|
|
221
232
|
"""
|
|
222
|
-
The
|
|
223
|
-
`counter_text`.
|
|
233
|
+
The text style to use for `counter`.
|
|
224
234
|
"""
|
|
225
235
|
|
|
226
236
|
error: Optional[StrOrControl] = None
|
|
227
237
|
"""
|
|
228
238
|
Text that appears below the input border.
|
|
229
239
|
|
|
230
|
-
If non-null, the border's color animates to red
|
|
240
|
+
If non-null, the border's color animates to red
|
|
241
|
+
and the [`helper`][flet.FormFieldControl.] is not shown.
|
|
231
242
|
"""
|
|
232
243
|
|
|
233
244
|
error_style: Optional[TextStyle] = None
|
|
234
245
|
"""
|
|
235
|
-
The [`
|
|
236
|
-
`error_text`.
|
|
246
|
+
The text style to use for [`error`][flet.FormFieldControl.].
|
|
237
247
|
"""
|
|
238
248
|
|
|
239
249
|
error_max_lines: Optional[int] = None
|
|
@@ -243,21 +253,22 @@ class FormFieldControl(LayoutControl):
|
|
|
243
253
|
|
|
244
254
|
prefix: Optional[StrOrControl] = None
|
|
245
255
|
"""
|
|
246
|
-
|
|
256
|
+
A `Control` to place on the line before the input.
|
|
257
|
+
|
|
258
|
+
It appears after the [`prefix_icon`][flet.FormFieldControl.], if both are specified.
|
|
247
259
|
|
|
248
260
|
This can be used, for example, to add some padding to text that would otherwise be
|
|
249
|
-
specified using `
|
|
261
|
+
specified using `prefix`, or to add a custom control in front of the input.
|
|
250
262
|
The control's baseline is lined up with the input baseline.
|
|
251
|
-
|
|
252
|
-
Only one of `prefix` and `prefix_text` can be specified.
|
|
253
|
-
|
|
254
|
-
The `prefix` appears after the `prefix_icon`, if both are specified.
|
|
255
263
|
"""
|
|
256
264
|
|
|
257
265
|
prefix_icon: Optional[IconDataOrControl] = None
|
|
258
266
|
"""
|
|
259
|
-
An icon that appears before the
|
|
260
|
-
|
|
267
|
+
An icon that appears before the editable part of the text field,
|
|
268
|
+
within the decoration's container.
|
|
269
|
+
|
|
270
|
+
If [`prefix`][flet.FormFieldControl.] is specified and visible,
|
|
271
|
+
this icon will appear to its left.
|
|
261
272
|
"""
|
|
262
273
|
|
|
263
274
|
prefix_icon_size_constraints: Optional[BoxConstraints] = None
|
|
@@ -267,27 +278,25 @@ class FormFieldControl(LayoutControl):
|
|
|
267
278
|
|
|
268
279
|
prefix_style: Optional[TextStyle] = None
|
|
269
280
|
"""
|
|
270
|
-
The [`
|
|
271
|
-
`prefix_text`.
|
|
281
|
+
The text style to use for [`prefix`][flet.FormFieldControl.].
|
|
272
282
|
"""
|
|
273
283
|
|
|
274
284
|
suffix: Optional[StrOrControl] = None
|
|
275
285
|
"""
|
|
276
|
-
|
|
286
|
+
A `Control` to place on the line after the input.
|
|
287
|
+
|
|
288
|
+
It appears before the [`suffix_icon`][flet.FormFieldControl.],
|
|
289
|
+
if both are specified.
|
|
277
290
|
|
|
278
291
|
This can be used, for example, to add some padding to the text that would otherwise
|
|
279
|
-
be specified using `
|
|
292
|
+
be specified using `suffix`, or to add a custom control after the input.
|
|
280
293
|
The control's baseline is lined up with the input baseline.
|
|
281
|
-
|
|
282
|
-
Only one of `suffix` and `suffix_text` can be specified.
|
|
283
|
-
|
|
284
|
-
The `suffix` appears before the `suffix_icon`, if both are specified.
|
|
285
294
|
"""
|
|
286
295
|
|
|
287
296
|
suffix_icon: Optional[IconDataOrControl] = None
|
|
288
297
|
"""
|
|
289
298
|
An icon that appears after the editable part of the text field and after the
|
|
290
|
-
`suffix`
|
|
299
|
+
[`suffix`][flet.FormFieldControl.], within the decoration's container.
|
|
291
300
|
"""
|
|
292
301
|
|
|
293
302
|
suffix_icon_size_constraints: Optional[BoxConstraints] = None
|
|
@@ -312,8 +321,7 @@ class FormFieldControl(LayoutControl):
|
|
|
312
321
|
|
|
313
322
|
suffix_style: Optional[TextStyle] = None
|
|
314
323
|
"""
|
|
315
|
-
The [`
|
|
316
|
-
`suffix_text`.
|
|
324
|
+
The text style to use for [`suffix`][flet.FormFieldControl.].
|
|
317
325
|
"""
|
|
318
326
|
|
|
319
327
|
async def focus(self):
|
|
@@ -38,28 +38,28 @@ class IconButton(LayoutControl, AdaptiveControl):
|
|
|
38
38
|
|
|
39
39
|
icon: Optional[IconDataOrControl] = None
|
|
40
40
|
"""
|
|
41
|
-
|
|
41
|
+
An icon to be shown in this button.
|
|
42
42
|
"""
|
|
43
43
|
|
|
44
44
|
icon_color: Optional[ColorValue] = None
|
|
45
45
|
"""
|
|
46
|
-
The foreground color of the icon.
|
|
46
|
+
The foreground color of the [`icon`][flet.IconButton.].
|
|
47
47
|
"""
|
|
48
48
|
|
|
49
49
|
icon_size: Optional[Number] = None
|
|
50
50
|
"""
|
|
51
|
-
The [`icon`][flet.IconButton.
|
|
51
|
+
The [`icon`][flet.IconButton.]'s size in virtual pixels.
|
|
52
52
|
|
|
53
53
|
Defaults to `24`.
|
|
54
54
|
"""
|
|
55
55
|
|
|
56
56
|
selected: Optional[bool] = None
|
|
57
57
|
"""
|
|
58
|
-
The optional selection state of
|
|
58
|
+
The optional selection state of this button.
|
|
59
59
|
|
|
60
60
|
If this property is not set, the button will behave as a normal push button,
|
|
61
|
-
otherwise, the button will toggle between showing [`icon`][flet.IconButton.
|
|
62
|
-
(when `False`), and [`selected_icon`][flet.IconButton.
|
|
61
|
+
otherwise, the button will toggle between showing [`icon`][flet.IconButton.]
|
|
62
|
+
(when `False`), and [`selected_icon`][flet.IconButton.] (when `True`).
|
|
63
63
|
"""
|
|
64
64
|
|
|
65
65
|
selected_icon: Optional[IconDataOrControl] = None
|
|
@@ -70,47 +70,17 @@ class IconButton(LayoutControl, AdaptiveControl):
|
|
|
70
70
|
selected_icon_color: Optional[ColorValue] = None
|
|
71
71
|
"""
|
|
72
72
|
The icon color for the 'selected' state of this button.
|
|
73
|
-
|
|
74
|
-
An example of icon toggle button:
|
|
75
|
-
|
|
76
|
-
<img src="/img/blog/gradients/toggle-icon-button.gif" className="screenshot-10" />
|
|
77
|
-
|
|
78
|
-
```python
|
|
79
|
-
import flet as ft
|
|
80
|
-
|
|
81
|
-
def main(page: ft.Page):
|
|
82
|
-
|
|
83
|
-
def toggle_icon_button(e):
|
|
84
|
-
e.control.selected = not e.control.selected
|
|
85
|
-
|
|
86
|
-
page.add(
|
|
87
|
-
ft.IconButton(
|
|
88
|
-
icon=ft.Icons.BATTERY_1_BAR,
|
|
89
|
-
selected_icon=ft.Icons.BATTERY_FULL,
|
|
90
|
-
on_click=toggle_icon_button,
|
|
91
|
-
selected=False,
|
|
92
|
-
style=ft.ButtonStyle(
|
|
93
|
-
color={
|
|
94
|
-
ft.ControlState.SELECTED: ft.Colors.GREEN,
|
|
95
|
-
ft.ControlState.DEFAULT: ft.Colors.RED
|
|
96
|
-
},
|
|
97
|
-
),
|
|
98
|
-
)
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
ft.run(main)
|
|
102
|
-
```
|
|
103
73
|
"""
|
|
104
74
|
|
|
105
75
|
bgcolor: Optional[ColorValue] = field(default=None, metadata={"skip": True})
|
|
106
76
|
"""
|
|
107
|
-
The
|
|
77
|
+
The background color of this button.
|
|
108
78
|
"""
|
|
109
79
|
|
|
110
80
|
highlight_color: Optional[ColorValue] = None
|
|
111
81
|
"""
|
|
112
|
-
The
|
|
113
|
-
|
|
82
|
+
The color of this button when it is pressed.
|
|
83
|
+
The highlight fades in quickly as this button is pressed/held down.
|
|
114
84
|
"""
|
|
115
85
|
|
|
116
86
|
style: Optional[ButtonStyle] = None
|
|
@@ -118,18 +88,15 @@ class IconButton(LayoutControl, AdaptiveControl):
|
|
|
118
88
|
Customizes this button's appearance.
|
|
119
89
|
|
|
120
90
|
Note:
|
|
121
|
-
- Only honoured in Material 3 design
|
|
122
|
-
|
|
123
|
-
- If [`Theme.use_material3`][flet.Theme.use_material3] is `True`,
|
|
91
|
+
- Only honoured in Material 3 design ([`Theme.use_material3`][flet.] is `True`).
|
|
92
|
+
- If [`Theme.use_material3`][flet.] is `True`,
|
|
124
93
|
any parameters defined in style will be overridden by the
|
|
125
|
-
corresponding parameters in this
|
|
126
|
-
For example, if icon button
|
|
127
|
-
[`
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
button will have [`VisualDensity.STANDARD`][flet.VisualDensity.STANDARD]
|
|
132
|
-
to define the button's layout.
|
|
94
|
+
corresponding parameters in this button.
|
|
95
|
+
For example, if icon button [`visual_density`][flet.IconButton.]
|
|
96
|
+
is set to [`VisualDensity.STANDARD`][flet.] and
|
|
97
|
+
style's [`visual_density`][flet.ButtonStyle.] is
|
|
98
|
+
set to [`VisualDensity.COMPACT`][flet.], [`VisualDensity.STANDARD`][flet.]
|
|
99
|
+
will be used.
|
|
133
100
|
"""
|
|
134
101
|
|
|
135
102
|
autofocus: bool = False
|
|
@@ -141,8 +108,7 @@ class IconButton(LayoutControl, AdaptiveControl):
|
|
|
141
108
|
|
|
142
109
|
disabled_color: Optional[ColorValue] = None
|
|
143
110
|
"""
|
|
144
|
-
The color to use for the icon inside the
|
|
145
|
-
button when disabled.
|
|
111
|
+
The color to use for the icon inside the button when disabled.
|
|
146
112
|
"""
|
|
147
113
|
|
|
148
114
|
hover_color: Optional[ColorValue] = None
|
|
@@ -157,8 +123,7 @@ class IconButton(LayoutControl, AdaptiveControl):
|
|
|
157
123
|
|
|
158
124
|
splash_color: Optional[ColorValue] = None
|
|
159
125
|
"""
|
|
160
|
-
The primary color of
|
|
161
|
-
button is in the down (pressed) state.
|
|
126
|
+
The primary color of this button when it is in the pressed state.
|
|
162
127
|
"""
|
|
163
128
|
|
|
164
129
|
splash_radius: Optional[Number] = None
|
|
@@ -167,15 +132,14 @@ class IconButton(LayoutControl, AdaptiveControl):
|
|
|
167
132
|
|
|
168
133
|
Note:
|
|
169
134
|
This value is honoured only when in Material 2
|
|
170
|
-
([`Theme.use_material3`][flet.
|
|
135
|
+
([`Theme.use_material3`][flet.] is `False`).
|
|
171
136
|
"""
|
|
172
137
|
|
|
173
138
|
alignment: Optional[Alignment] = None
|
|
174
139
|
"""
|
|
175
|
-
Defines how the icon is positioned within
|
|
176
|
-
of [`Alignment`][flet.Alignment] class.
|
|
140
|
+
Defines how the icon is positioned within this button.
|
|
177
141
|
|
|
178
|
-
Defaults to [`Alignment.CENTER`][flet.
|
|
142
|
+
Defaults to [`Alignment.CENTER`][flet.].
|
|
179
143
|
"""
|
|
180
144
|
|
|
181
145
|
padding: Optional[PaddingValue] = None
|
|
@@ -197,7 +161,7 @@ class IconButton(LayoutControl, AdaptiveControl):
|
|
|
197
161
|
"""
|
|
198
162
|
The URL to open when this button is clicked.
|
|
199
163
|
|
|
200
|
-
Additionally, if [`on_click`][flet.IconButton.
|
|
164
|
+
Additionally, if [`on_click`][flet.IconButton.] event callback is provided,
|
|
201
165
|
it is fired after that.
|
|
202
166
|
"""
|
|
203
167
|
|
|
@@ -211,7 +175,7 @@ class IconButton(LayoutControl, AdaptiveControl):
|
|
|
211
175
|
default=None, metadata={"skip": True}
|
|
212
176
|
)
|
|
213
177
|
"""
|
|
214
|
-
Defines how compact
|
|
178
|
+
Defines how compact this button's layout will be.
|
|
215
179
|
"""
|
|
216
180
|
|
|
217
181
|
size_constraints: Optional[BoxConstraints] = None
|
|
@@ -226,12 +190,12 @@ class IconButton(LayoutControl, AdaptiveControl):
|
|
|
226
190
|
|
|
227
191
|
on_focus: Optional[ControlEventHandler["IconButton"]] = None
|
|
228
192
|
"""
|
|
229
|
-
Called when
|
|
193
|
+
Called when this button has received focus.
|
|
230
194
|
"""
|
|
231
195
|
|
|
232
196
|
on_blur: Optional[ControlEventHandler["IconButton"]] = None
|
|
233
197
|
"""
|
|
234
|
-
Called when
|
|
198
|
+
Called when this button has lost focus.
|
|
235
199
|
"""
|
|
236
200
|
|
|
237
201
|
def before_update(self):
|
|
@@ -261,7 +225,7 @@ class IconButton(LayoutControl, AdaptiveControl):
|
|
|
261
225
|
@control("FilledIconButton")
|
|
262
226
|
class FilledIconButton(IconButton):
|
|
263
227
|
"""
|
|
264
|
-
A filled variant of [`IconButton`][flet.
|
|
228
|
+
A filled variant of [`IconButton`][flet.].
|
|
265
229
|
|
|
266
230
|
Filled icon buttons have higher visual impact and should be used for high emphasis
|
|
267
231
|
actions, such as turning off a microphone or camera.
|
|
@@ -271,7 +235,7 @@ class FilledIconButton(IconButton):
|
|
|
271
235
|
@control("FilledTonalIconButton")
|
|
272
236
|
class FilledTonalIconButton(IconButton):
|
|
273
237
|
"""
|
|
274
|
-
A filled tonal variant of [`IconButton`][flet.
|
|
238
|
+
A filled tonal variant of [`IconButton`][flet.].
|
|
275
239
|
|
|
276
240
|
Filled tonal icon buttons are a middle ground between filled and
|
|
277
241
|
outlined icon buttons. They're useful in contexts where the button requires
|
|
@@ -283,7 +247,7 @@ class FilledTonalIconButton(IconButton):
|
|
|
283
247
|
@control("OutlinedIconButton")
|
|
284
248
|
class OutlinedIconButton(IconButton):
|
|
285
249
|
"""
|
|
286
|
-
An outlined variant of [`IconButton`][flet.
|
|
250
|
+
An outlined variant of [`IconButton`][flet.].
|
|
287
251
|
|
|
288
252
|
Outlined icon buttons are medium-emphasis buttons.
|
|
289
253
|
They're useful when an icon button needs more emphasis than a
|
|
@@ -53,21 +53,21 @@ class ListTile(LayoutControl, AdaptiveControl):
|
|
|
53
53
|
"""
|
|
54
54
|
A control to display as primary content of the list tile.
|
|
55
55
|
|
|
56
|
-
Typically a [`Text`][flet.
|
|
57
|
-
wrap. To enforce the single line limit, use [`Text.max_lines`][flet.
|
|
56
|
+
Typically a [`Text`][flet.] control. This should not
|
|
57
|
+
wrap. To enforce the single line limit, use [`Text.max_lines`][flet.].
|
|
58
58
|
"""
|
|
59
59
|
|
|
60
60
|
subtitle: Optional[StrOrControl] = None
|
|
61
61
|
"""
|
|
62
62
|
Additional content displayed below the title.
|
|
63
63
|
|
|
64
|
-
If [`is_three_line`][
|
|
64
|
+
If [`is_three_line`][(c).] is `False`, this should not wrap.
|
|
65
65
|
If `is_three_line` is `True`, this should be configured to take a maximum of two
|
|
66
66
|
lines.
|
|
67
|
-
For example, you can use [`Text.max_lines`][flet.
|
|
67
|
+
For example, you can use [`Text.max_lines`][flet.] to enforce the
|
|
68
68
|
number of lines.
|
|
69
69
|
|
|
70
|
-
Typically a [`Text`][flet.
|
|
70
|
+
Typically a [`Text`][flet.] control.
|
|
71
71
|
"""
|
|
72
72
|
|
|
73
73
|
is_three_line: Optional[bool] = None
|
|
@@ -81,19 +81,19 @@ class ListTile(LayoutControl, AdaptiveControl):
|
|
|
81
81
|
treated as having two lines if the subtitle is non-null.
|
|
82
82
|
|
|
83
83
|
When using a Text control for title and subtitle, you can enforce line limits
|
|
84
|
-
using [`Text.max_lines`][flet.
|
|
84
|
+
using [`Text.max_lines`][flet.].
|
|
85
85
|
"""
|
|
86
86
|
|
|
87
87
|
leading: Optional[IconDataOrControl] = None
|
|
88
88
|
"""
|
|
89
|
-
A control to display before the [`title`][
|
|
89
|
+
A control to display before the [`title`][(c).].
|
|
90
90
|
"""
|
|
91
91
|
|
|
92
92
|
trailing: Optional[IconDataOrControl] = None
|
|
93
93
|
"""
|
|
94
|
-
A control to display after the [`title`][
|
|
94
|
+
A control to display after the [`title`][(c).].
|
|
95
95
|
|
|
96
|
-
Typically an [`Icon`][flet.
|
|
96
|
+
Typically an [`Icon`][flet.] control.
|
|
97
97
|
"""
|
|
98
98
|
|
|
99
99
|
content_padding: Optional[PaddingValue] = None
|
|
@@ -115,7 +115,9 @@ class ListTile(LayoutControl, AdaptiveControl):
|
|
|
115
115
|
|
|
116
116
|
hover_color: Optional[ColorValue] = None
|
|
117
117
|
"""
|
|
118
|
-
The tile's color when hovered. Only
|
|
118
|
+
The tile's color when hovered. Only takes effect if
|
|
119
|
+
[`toggle_inputs`][(c).] is True or if
|
|
120
|
+
[`on_click`][(c).] is provided.
|
|
119
121
|
"""
|
|
120
122
|
|
|
121
123
|
selected: bool = False
|
|
@@ -140,8 +142,8 @@ class ListTile(LayoutControl, AdaptiveControl):
|
|
|
140
142
|
|
|
141
143
|
toggle_inputs: bool = False
|
|
142
144
|
"""
|
|
143
|
-
Whether clicking on a list tile should toggle the state of [`Radio`][flet.
|
|
144
|
-
[`Checkbox`][flet.
|
|
145
|
+
Whether clicking on a list tile should toggle the state of [`Radio`][flet.],
|
|
146
|
+
[`Checkbox`][flet.] or [`Switch`][flet.] inside this tile.
|
|
145
147
|
"""
|
|
146
148
|
|
|
147
149
|
selected_color: Optional[ColorValue] = None
|
|
@@ -173,7 +175,7 @@ class ListTile(LayoutControl, AdaptiveControl):
|
|
|
173
175
|
horizontal_spacing: Optional[Number] = None
|
|
174
176
|
"""
|
|
175
177
|
The horizontal gap between the `title` and the
|
|
176
|
-
[`leading`][
|
|
178
|
+
[`leading`][(c).] and [`trailing`][(c).]
|
|
177
179
|
controls.
|
|
178
180
|
"""
|
|
179
181
|
|
|
@@ -191,7 +193,7 @@ class ListTile(LayoutControl, AdaptiveControl):
|
|
|
191
193
|
"""
|
|
192
194
|
The URL to open when this button is clicked.
|
|
193
195
|
|
|
194
|
-
Additionally, if [`on_click`][
|
|
196
|
+
Additionally, if [`on_click`][(c).] event callback is provided,
|
|
195
197
|
it is fired after that.
|
|
196
198
|
"""
|
|
197
199
|
|
|
@@ -207,15 +209,15 @@ class ListTile(LayoutControl, AdaptiveControl):
|
|
|
207
209
|
icon_color: Optional[ColorValue] = None
|
|
208
210
|
"""
|
|
209
211
|
Defines the default color for the icons
|
|
210
|
-
present in [`leading`][
|
|
211
|
-
[`trailing`][
|
|
212
|
+
present in [`leading`][(c).] and
|
|
213
|
+
[`trailing`][(c).].
|
|
212
214
|
"""
|
|
213
215
|
|
|
214
216
|
text_color: Optional[ColorValue] = None
|
|
215
217
|
"""
|
|
216
218
|
The color used for
|
|
217
|
-
texts in [`title`][
|
|
218
|
-
[`leading`][
|
|
219
|
+
texts in [`title`][(c).], [`subtitle`][(c).],
|
|
220
|
+
[`leading`][(c).], and [`trailing`][(c).].
|
|
219
221
|
"""
|
|
220
222
|
|
|
221
223
|
shape: Optional[OutlinedBorder] = None
|
|
@@ -231,25 +233,25 @@ class ListTile(LayoutControl, AdaptiveControl):
|
|
|
231
233
|
mouse_cursor: Optional[MouseCursor] = None
|
|
232
234
|
"""
|
|
233
235
|
The cursor to be displayed when a mouse pointer enters or is hovering over this
|
|
234
|
-
control. The value is [`MouseCursor`][flet.
|
|
236
|
+
control. The value is [`MouseCursor`][flet.]
|
|
235
237
|
enum.
|
|
236
238
|
"""
|
|
237
239
|
|
|
238
240
|
title_text_style: Optional[TextStyle] = None
|
|
239
241
|
"""
|
|
240
|
-
The [`TextStyle`][flet.
|
|
242
|
+
The [`TextStyle`][flet.] for the [`title`][(c).]
|
|
241
243
|
control.
|
|
242
244
|
"""
|
|
243
245
|
|
|
244
246
|
subtitle_text_style: Optional[TextStyle] = None
|
|
245
247
|
"""
|
|
246
|
-
The [`TextStyle`][flet.
|
|
248
|
+
The [`TextStyle`][flet.] for the
|
|
247
249
|
`subtitle` control.
|
|
248
250
|
"""
|
|
249
251
|
|
|
250
252
|
leading_and_trailing_text_style: Optional[TextStyle] = None
|
|
251
253
|
"""
|
|
252
|
-
The [`TextStyle`][flet.
|
|
254
|
+
The [`TextStyle`][flet.] for the
|
|
253
255
|
`leading` and `trailing` controls.
|
|
254
256
|
"""
|
|
255
257
|
|
|
@@ -259,7 +261,7 @@ class ListTile(LayoutControl, AdaptiveControl):
|
|
|
259
261
|
|
|
260
262
|
If `None` or not set, default tile heights are `56.0`, `72.0`, and `88.0` for one,
|
|
261
263
|
two, and three lines of text respectively.
|
|
262
|
-
If [`dense`][
|
|
264
|
+
If [`dense`][(c).] is `True`, these
|
|
263
265
|
defaults are changed to `48.0`, `64.0`, and `76.0`.
|
|
264
266
|
|
|
265
267
|
Note that, a visual density value or a large title will also adjust the default
|
|
@@ -39,14 +39,14 @@ class MenuItemButton(LayoutControl):
|
|
|
39
39
|
"""
|
|
40
40
|
An optional control to display before the `content`.
|
|
41
41
|
|
|
42
|
-
Typically an [`Icon`][flet.
|
|
42
|
+
Typically an [`Icon`][flet.] control.
|
|
43
43
|
"""
|
|
44
44
|
|
|
45
45
|
trailing: Optional[Control] = None
|
|
46
46
|
"""
|
|
47
47
|
An optional control to display after the `content`.
|
|
48
48
|
|
|
49
|
-
Typically an [`Icon`][flet.
|
|
49
|
+
Typically an [`Icon`][flet.] control.
|
|
50
50
|
"""
|
|
51
51
|
|
|
52
52
|
clip_behavior: ClipBehavior = ClipBehavior.NONE
|
|
@@ -130,7 +130,7 @@ class NavigationBar(LayoutControl, AdaptiveControl):
|
|
|
130
130
|
label_padding: Optional[PaddingValue] = None
|
|
131
131
|
"""
|
|
132
132
|
The padding around the
|
|
133
|
-
[`NavigationBarDestination.label`][flet.
|
|
133
|
+
[`NavigationBarDestination.label`][flet.].
|
|
134
134
|
"""
|
|
135
135
|
|
|
136
136
|
elevation: Optional[Number] = None
|
|
@@ -168,9 +168,9 @@ class NavigationBar(LayoutControl, AdaptiveControl):
|
|
|
168
168
|
overlay_color: Optional[ControlStateValue[ColorValue]] = None
|
|
169
169
|
"""
|
|
170
170
|
The highlight color of the `NavigationBarDestination` in various
|
|
171
|
-
[`ControlState`][flet.
|
|
171
|
+
[`ControlState`][flet.] states.
|
|
172
172
|
|
|
173
|
-
The following [`ControlState`][flet.
|
|
173
|
+
The following [`ControlState`][flet.]
|
|
174
174
|
values are supported: `PRESSED`, `HOVERED` and `FOCUSED`.
|
|
175
175
|
"""
|
|
176
176
|
|