flet 0.70.0.dev5620__py3-none-any.whl → 0.70.0.dev5771__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 +21 -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 +41 -32
- 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 +669 -608
- flet/controls/types.py +11 -11
- flet/testing/flet_test_app.py +4 -4
- flet/version.py +1 -1
- {flet-0.70.0.dev5620.dist-info → flet-0.70.0.dev5771.dist-info}/METADATA +5 -5
- flet-0.70.0.dev5771.dist-info/RECORD +239 -0
- flet-0.70.0.dev5620.dist-info/RECORD +0 -238
- {flet-0.70.0.dev5620.dist-info → flet-0.70.0.dev5771.dist-info}/WHEEL +0 -0
- {flet-0.70.0.dev5620.dist-info → flet-0.70.0.dev5771.dist-info}/entry_points.txt +0 -0
- {flet-0.70.0.dev5620.dist-info → flet-0.70.0.dev5771.dist-info}/top_level.txt +0 -0
flet/controls/material/slider.py
CHANGED
|
@@ -36,7 +36,7 @@ class Slider(LayoutControl, AdaptiveControl):
|
|
|
36
36
|
Raises:
|
|
37
37
|
AssertionError: If [`min`][(c).] is greater than or equal to [`max`][(c).].
|
|
38
38
|
AssertionError: If [`min`][(c).] is greater than or equal to [`value`][(c).].
|
|
39
|
-
AssertionError: If [`max`][(c).] is less than or equal to [`value`][(c)].
|
|
39
|
+
AssertionError: If [`max`][(c).] is less than or equal to [`value`][(c).].
|
|
40
40
|
"""
|
|
41
41
|
|
|
42
42
|
value: Optional[Number] = None
|
|
@@ -45,7 +45,7 @@ class Slider(LayoutControl, AdaptiveControl):
|
|
|
45
45
|
|
|
46
46
|
The slider's thumb is drawn at a position that corresponds to this value.
|
|
47
47
|
|
|
48
|
-
Defaults to value of [`min`][
|
|
48
|
+
Defaults to value of [`min`][(c).].
|
|
49
49
|
"""
|
|
50
50
|
|
|
51
51
|
label: Optional[str] = None
|
|
@@ -65,8 +65,8 @@ class Slider(LayoutControl, AdaptiveControl):
|
|
|
65
65
|
The minimum value the user can select.
|
|
66
66
|
|
|
67
67
|
Note:
|
|
68
|
-
- Must be less than or equal to [`max`][
|
|
69
|
-
- If the [`max`][
|
|
68
|
+
- Must be less than or equal to [`max`][(c).].
|
|
69
|
+
- If the [`max`][(c).] is equal to the `min`, then this slider
|
|
70
70
|
is disabled.
|
|
71
71
|
"""
|
|
72
72
|
|
|
@@ -75,8 +75,8 @@ class Slider(LayoutControl, AdaptiveControl):
|
|
|
75
75
|
The maximum value the user can select.
|
|
76
76
|
|
|
77
77
|
Note:
|
|
78
|
-
- Must be greater than or equal to [`min`][
|
|
79
|
-
- If the [`min`][
|
|
78
|
+
- Must be greater than or equal to [`min`][(c).].
|
|
79
|
+
- If the [`min`][(c).] is equal to the `max`, then this slider
|
|
80
80
|
is disabled.
|
|
81
81
|
"""
|
|
82
82
|
|
|
@@ -84,15 +84,15 @@ class Slider(LayoutControl, AdaptiveControl):
|
|
|
84
84
|
"""
|
|
85
85
|
The number of discrete divisions.
|
|
86
86
|
|
|
87
|
-
Typically used with [`label`][
|
|
87
|
+
Typically used with [`label`][(c).] to show the current discrete value.
|
|
88
88
|
|
|
89
89
|
If `None`, this slider is continuous.
|
|
90
90
|
"""
|
|
91
91
|
|
|
92
92
|
round: int = 0
|
|
93
93
|
"""
|
|
94
|
-
The number of decimals displayed on the [`label`][
|
|
95
|
-
containing [`value`][
|
|
94
|
+
The number of decimals displayed on the [`label`][(c).]
|
|
95
|
+
containing [`value`][(c).].
|
|
96
96
|
|
|
97
97
|
Defaults to `0`, which displays value rounded to the nearest integer.
|
|
98
98
|
"""
|
|
@@ -131,24 +131,24 @@ class Slider(LayoutControl, AdaptiveControl):
|
|
|
131
131
|
"""
|
|
132
132
|
The allowed way for the user to interact with this slider.
|
|
133
133
|
|
|
134
|
-
If `None`, [`SliderTheme.interaction`][flet.
|
|
134
|
+
If `None`, [`SliderTheme.interaction`][flet.] is used.
|
|
135
135
|
If that's is also `None`, defaults to
|
|
136
|
-
[`SliderInteraction.TAP_AND_SLIDE`][flet.
|
|
136
|
+
[`SliderInteraction.TAP_AND_SLIDE`][flet.].
|
|
137
137
|
"""
|
|
138
138
|
|
|
139
139
|
secondary_active_color: Optional[ColorValue] = None
|
|
140
140
|
"""
|
|
141
141
|
The color to use for the portion of
|
|
142
142
|
the slider track between the thumb and
|
|
143
|
-
the [`secondary_track_value`][
|
|
143
|
+
the [`secondary_track_value`][(c).].
|
|
144
144
|
"""
|
|
145
145
|
|
|
146
146
|
overlay_color: Optional[ControlStateValue[ColorValue]] = None
|
|
147
147
|
"""
|
|
148
148
|
The highlight color that's typically
|
|
149
149
|
used to indicate that the range slider thumb is in
|
|
150
|
-
[`ControlState.HOVERED`][flet.
|
|
151
|
-
[`ControlState.DRAGGED`][flet.
|
|
150
|
+
[`ControlState.HOVERED`][flet.] or
|
|
151
|
+
[`ControlState.DRAGGED`][flet.] states.
|
|
152
152
|
"""
|
|
153
153
|
|
|
154
154
|
secondary_track_value: Optional[Number] = None
|
|
@@ -182,10 +182,10 @@ class Slider(LayoutControl, AdaptiveControl):
|
|
|
182
182
|
When `True`, the Slider will use the 2023 Material Design 3 appearance.
|
|
183
183
|
|
|
184
184
|
If not set, then the
|
|
185
|
-
[`SliderTheme.year_2023`][flet.
|
|
185
|
+
[`SliderTheme.year_2023`][flet.] will be
|
|
186
186
|
used, which is `False` by default.
|
|
187
187
|
|
|
188
|
-
If [`Theme.use_material3`][flet.
|
|
188
|
+
If [`Theme.use_material3`][flet.] is `False`,
|
|
189
189
|
then this property is ignored.
|
|
190
190
|
"""
|
|
191
191
|
|
|
@@ -17,7 +17,7 @@ from flet.controls.types import (
|
|
|
17
17
|
StrOrControl,
|
|
18
18
|
)
|
|
19
19
|
|
|
20
|
-
__all__ = ["
|
|
20
|
+
__all__ = ["DismissDirection", "SnackBar", "SnackBarAction", "SnackBarBehavior"]
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
class SnackBarBehavior(Enum):
|
|
@@ -38,14 +38,15 @@ class DismissDirection(Enum):
|
|
|
38
38
|
@control("SnackBar")
|
|
39
39
|
class SnackBarAction(Control):
|
|
40
40
|
"""
|
|
41
|
-
A button that can be used as an action in a [`SnackBar`][flet.
|
|
41
|
+
A button that can be used as an action in a [`SnackBar`][flet.].
|
|
42
42
|
|
|
43
|
-
An action button for a [`SnackBar`][flet.
|
|
43
|
+
An action button for a [`SnackBar`][flet.].
|
|
44
44
|
|
|
45
45
|
Note:
|
|
46
46
|
- Snack bar actions are always enabled. Instead of disabling a snack bar
|
|
47
47
|
action, avoid including it in the snack bar in the first place.
|
|
48
|
-
- Snack bar actions can will only respond to first click.
|
|
48
|
+
- Snack bar actions can will only respond to first click.
|
|
49
|
+
Subsequent clicks/presses are ignored.
|
|
49
50
|
"""
|
|
50
51
|
|
|
51
52
|
label: str
|
|
@@ -56,8 +57,8 @@ class SnackBarAction(Control):
|
|
|
56
57
|
text_color: Optional[ColorValue] = None
|
|
57
58
|
"""
|
|
58
59
|
The button label color.
|
|
59
|
-
|
|
60
|
-
If `None`, [`SnackBarTheme.action_text_color`][flet.
|
|
60
|
+
|
|
61
|
+
If `None`, [`SnackBarTheme.action_text_color`][flet.] is used.
|
|
61
62
|
"""
|
|
62
63
|
|
|
63
64
|
disabled_text_color: Optional[ColorValue] = None
|
|
@@ -69,8 +70,8 @@ class SnackBarAction(Control):
|
|
|
69
70
|
bgcolor: Optional[ColorValue] = None
|
|
70
71
|
"""
|
|
71
72
|
The button background fill color.
|
|
72
|
-
|
|
73
|
-
If `None`, [`SnackBarTheme.action_bgcolor`][flet.
|
|
73
|
+
|
|
74
|
+
If `None`, [`SnackBarTheme.action_bgcolor`][flet.] is used.
|
|
74
75
|
"""
|
|
75
76
|
|
|
76
77
|
disabled_bgcolor: Optional[ColorValue] = None
|
|
@@ -78,7 +79,7 @@ class SnackBarAction(Control):
|
|
|
78
79
|
The button disabled background color.
|
|
79
80
|
This color is shown after the action is dismissed.
|
|
80
81
|
|
|
81
|
-
If `None`, [`SnackBarTheme.disabled_action_bgcolor`][flet.
|
|
82
|
+
If `None`, [`SnackBarTheme.disabled_action_bgcolor`][flet.] is used.
|
|
82
83
|
"""
|
|
83
84
|
|
|
84
85
|
on_click: Optional[ControlEventHandler["SnackBarAction"]] = None
|
|
@@ -98,7 +99,7 @@ class SnackBar(DialogControl):
|
|
|
98
99
|
"""
|
|
99
100
|
The primary content of the snack bar.
|
|
100
101
|
|
|
101
|
-
Typically a [`Text`][flet.
|
|
102
|
+
Typically a [`Text`][flet.] control.
|
|
102
103
|
"""
|
|
103
104
|
|
|
104
105
|
behavior: Optional[SnackBarBehavior] = None
|
|
@@ -106,26 +107,26 @@ class SnackBar(DialogControl):
|
|
|
106
107
|
This defines the behavior and location of the snack bar.
|
|
107
108
|
|
|
108
109
|
Defines where a SnackBar should appear within a page and how its location
|
|
109
|
-
should be adjusted when the page also includes a [`FloatingActionButton`][flet.
|
|
110
|
-
[`NavigationBar`][flet.
|
|
110
|
+
should be adjusted when the page also includes a [`FloatingActionButton`][flet.]
|
|
111
|
+
or a [`NavigationBar`][flet.].
|
|
111
112
|
|
|
112
|
-
If `None`, [`SnackBarTheme.behavior`][flet.
|
|
113
|
-
If that's is also `None`, defaults to [`SnackBarBehavior.FIXED`][flet.
|
|
113
|
+
If `None`, [`SnackBarTheme.behavior`][flet.] is used.
|
|
114
|
+
If that's is also `None`, defaults to [`SnackBarBehavior.FIXED`][flet.].
|
|
114
115
|
|
|
115
116
|
Note:
|
|
116
|
-
- If [`behavior`][
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
- [`width`][
|
|
120
|
-
|
|
117
|
+
- If [`behavior`][(c).] is [`SnackBarBehavior.FLOATING`][flet.], the length of
|
|
118
|
+
the bar is defined by either [`width`][(c).] and [`margin`][(c).], and if
|
|
119
|
+
both are specified, `width` takes precedence over `margin`.
|
|
120
|
+
- [`width`][(c).] and [`margin`][(c).] are ignored if [`behavior`][(c).]
|
|
121
|
+
is not [`SnackBarBehavior.FLOATING`][flet.].
|
|
121
122
|
"""
|
|
122
123
|
|
|
123
124
|
dismiss_direction: Optional[DismissDirection] = None
|
|
124
125
|
"""
|
|
125
126
|
The direction in which the SnackBar can be dismissed.
|
|
126
127
|
|
|
127
|
-
If `None`, [`SnackBarTheme.dismiss_direction`][flet.
|
|
128
|
-
If that's is also `None`, defaults to [`DismissDirection.DOWN`][flet.
|
|
128
|
+
If `None`, [`SnackBarTheme.dismiss_direction`][flet.] is used.
|
|
129
|
+
If that's is also `None`, defaults to [`DismissDirection.DOWN`][flet.].
|
|
129
130
|
"""
|
|
130
131
|
|
|
131
132
|
show_close_icon: bool = False
|
|
@@ -147,7 +148,7 @@ class SnackBar(DialogControl):
|
|
|
147
148
|
|
|
148
149
|
close_icon_color: Optional[ColorValue] = None
|
|
149
150
|
"""
|
|
150
|
-
The color of the close icon, if [`show_close_icon`][
|
|
151
|
+
The color of the close icon, if [`show_close_icon`][(c).] is `True`.
|
|
151
152
|
"""
|
|
152
153
|
|
|
153
154
|
bgcolor: Optional[ColorValue] = None
|
|
@@ -181,7 +182,7 @@ class SnackBar(DialogControl):
|
|
|
181
182
|
available space.
|
|
182
183
|
|
|
183
184
|
Note:
|
|
184
|
-
Has effect only when [`behavior`][
|
|
185
|
+
Has effect only when [`behavior`][(c).] is [`SnackBarBehavior.FLOATING`][flet.].
|
|
185
186
|
It can not be used if `margin` is specified.
|
|
186
187
|
"""
|
|
187
188
|
|
|
@@ -198,20 +199,20 @@ class SnackBar(DialogControl):
|
|
|
198
199
|
|
|
199
200
|
clip_behavior: ClipBehavior = ClipBehavior.HARD_EDGE
|
|
200
201
|
"""
|
|
201
|
-
The [`content`][
|
|
202
|
+
The [`content`][(c).] will be clipped (or not) according to this option.
|
|
202
203
|
"""
|
|
203
204
|
|
|
204
205
|
action_overflow_threshold: Number = 0.25
|
|
205
206
|
"""
|
|
206
|
-
The percentage threshold for [`action`][
|
|
207
|
+
The percentage threshold for [`action`][(c).]'s width before
|
|
207
208
|
it overflows to a new line.
|
|
208
209
|
|
|
209
|
-
If the width of the snackbar's [`content`][
|
|
210
|
-
width of the snackbar minus the width of its `action`, then the `action`
|
|
211
|
-
appear below the `content
|
|
210
|
+
If the width of the snackbar's [`content`][(c).] is greater than this percentage
|
|
211
|
+
of the width of the snackbar minus the width of its `action`, then the `action`
|
|
212
|
+
will appear below the [`content`][(c).].
|
|
212
213
|
|
|
213
214
|
At a value of `0.0`, the `action` will not overflow to a new line.
|
|
214
|
-
|
|
215
|
+
|
|
215
216
|
Note:
|
|
216
217
|
Must be between `0.0` and `1.0` inclusive.
|
|
217
218
|
"""
|
|
@@ -235,6 +236,6 @@ class SnackBar(DialogControl):
|
|
|
235
236
|
self.action_overflow_threshold is None
|
|
236
237
|
or 0 <= self.action_overflow_threshold <= 1
|
|
237
238
|
), "action_overflow_threshold must be between 0 and 1 inclusive"
|
|
238
|
-
assert (
|
|
239
|
-
|
|
240
|
-
)
|
|
239
|
+
assert self.elevation is None or self.elevation >= 0, (
|
|
240
|
+
"elevation cannot be negative"
|
|
241
|
+
)
|
|
@@ -18,21 +18,21 @@ class SubmenuButton(LayoutControl):
|
|
|
18
18
|
"""
|
|
19
19
|
A menu button that displays a cascading menu.
|
|
20
20
|
|
|
21
|
-
Typically used in a [`MenuBar`][flet.
|
|
21
|
+
Typically used in a [`MenuBar`][flet.] control.
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
24
|
content: Optional[StrOrControl] = None
|
|
25
25
|
"""
|
|
26
26
|
The child control to be displayed in the middle portion of this button.
|
|
27
27
|
|
|
28
|
-
Typically this is the button's label, using a [`Text`][flet.
|
|
28
|
+
Typically this is the button's label, using a [`Text`][flet.] control.
|
|
29
29
|
"""
|
|
30
30
|
|
|
31
31
|
controls: list[Control] = field(default_factory=list)
|
|
32
32
|
"""
|
|
33
33
|
A list of controls that appear in the menu when it is opened.
|
|
34
34
|
|
|
35
|
-
Typically either [`MenuItemButton`][flet.
|
|
35
|
+
Typically either [`MenuItemButton`][flet.] or
|
|
36
36
|
`SubMenuButton` controls.
|
|
37
37
|
|
|
38
38
|
If this list is empty, then the button for this menu item will be disabled.
|
|
@@ -40,16 +40,16 @@ class SubmenuButton(LayoutControl):
|
|
|
40
40
|
|
|
41
41
|
leading: Optional[Control] = None
|
|
42
42
|
"""
|
|
43
|
-
An optional control to display before the [`content`][
|
|
43
|
+
An optional control to display before the [`content`][(c).].
|
|
44
44
|
|
|
45
|
-
Typically an [`Icon`][flet.
|
|
45
|
+
Typically an [`Icon`][flet.] control.
|
|
46
46
|
"""
|
|
47
47
|
|
|
48
48
|
trailing: Optional[Control] = None
|
|
49
49
|
"""
|
|
50
|
-
An optional control to display after the [`content`][
|
|
50
|
+
An optional control to display after the [`content`][(c).].
|
|
51
51
|
|
|
52
|
-
Typically an [`Icon`][flet.
|
|
52
|
+
Typically an [`Icon`][flet.] control.
|
|
53
53
|
"""
|
|
54
54
|
|
|
55
55
|
clip_behavior: ClipBehavior = ClipBehavior.HARD_EDGE
|
|
@@ -70,8 +70,8 @@ class SubmenuButton(LayoutControl):
|
|
|
70
70
|
alignment_offset: Optional[OffsetValue] = None
|
|
71
71
|
"""
|
|
72
72
|
The offset of the menu relative to the alignment origin determined by
|
|
73
|
-
[`MenuStyle.alignment`][flet.
|
|
74
|
-
[`style`][
|
|
73
|
+
[`MenuStyle.alignment`][flet.] on the
|
|
74
|
+
[`style`][(c).] attribute.
|
|
75
75
|
"""
|
|
76
76
|
|
|
77
77
|
on_open: Optional[ControlEventHandler["SubmenuButton"]] = None
|
flet/controls/material/switch.py
CHANGED
|
@@ -38,12 +38,12 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
38
38
|
|
|
39
39
|
label_position: LabelPosition = LabelPosition.RIGHT
|
|
40
40
|
"""
|
|
41
|
-
The position of the [`label`][
|
|
41
|
+
The position of the [`label`][(c).], if provided.
|
|
42
42
|
"""
|
|
43
43
|
|
|
44
44
|
label_text_style: Optional[TextStyle] = None
|
|
45
45
|
"""
|
|
46
|
-
The [`label`][
|
|
46
|
+
The [`label`][(c).]'s text style, when it is a string.
|
|
47
47
|
"""
|
|
48
48
|
|
|
49
49
|
value: bool = False
|
|
@@ -69,7 +69,7 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
69
69
|
The color to use on the track when
|
|
70
70
|
this switch is on.
|
|
71
71
|
|
|
72
|
-
If [`track_color`][
|
|
72
|
+
If [`track_color`][(c).] returns a non-none color in
|
|
73
73
|
the `ControlState.SELECTED` state, it will
|
|
74
74
|
be used instead of this color.
|
|
75
75
|
"""
|
|
@@ -88,7 +88,7 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
88
88
|
Defaults to colors defined in the
|
|
89
89
|
[material design specification](https://m3.material.io/components/switch/specs).
|
|
90
90
|
|
|
91
|
-
If [`thumb_color`][
|
|
91
|
+
If [`thumb_color`][(c).] returns a non-none color
|
|
92
92
|
in the `ControlState.DEFAULT` state, it will be
|
|
93
93
|
used instead of this color.
|
|
94
94
|
"""
|
|
@@ -101,7 +101,7 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
101
101
|
Defaults to colors defined in the
|
|
102
102
|
[material design specification](https://m3.material.io/components/switch/specs).
|
|
103
103
|
|
|
104
|
-
If [`track_color`][
|
|
104
|
+
If [`track_color`][(c).] returns a non-none color
|
|
105
105
|
in the `ControlState.DEFAULT` state, it will be
|
|
106
106
|
used instead of this color.
|
|
107
107
|
"""
|
|
@@ -109,7 +109,7 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
109
109
|
thumb_color: Optional[ControlStateValue[ColorValue]] = None
|
|
110
110
|
"""
|
|
111
111
|
The color of this switch's thumb
|
|
112
|
-
in various [`ControlState`][flet.
|
|
112
|
+
in various [`ControlState`][flet.]
|
|
113
113
|
states.
|
|
114
114
|
|
|
115
115
|
The following states are supported: `ControlState.SELECTED`, `ControlState.HOVERED`,
|
|
@@ -120,7 +120,7 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
120
120
|
thumb_icon: Optional[ControlStateValue[IconData]] = None
|
|
121
121
|
"""
|
|
122
122
|
The icon of this Switch's thumb in various
|
|
123
|
-
[`ControlState`][flet.
|
|
123
|
+
[`ControlState`][flet.] states.
|
|
124
124
|
|
|
125
125
|
The following states are supported: `ControlState.SELECTED`, `ControlState.HOVERED`,
|
|
126
126
|
`ControlState.DISABLED`, `ControlState.FOCUSED` and
|
|
@@ -130,7 +130,7 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
130
130
|
track_color: Optional[ControlStateValue[ColorValue]] = None
|
|
131
131
|
"""
|
|
132
132
|
The color of this switch's track
|
|
133
|
-
in various [`ControlState`][flet.
|
|
133
|
+
in various [`ControlState`][flet.] states.
|
|
134
134
|
|
|
135
135
|
The following states are supported: `ControlState.SELECTED`,
|
|
136
136
|
`ControlState.HOVERED`, `ControlState.DISABLED`, `ControlState.FOCUSED` and
|
|
@@ -141,7 +141,7 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
141
141
|
"""
|
|
142
142
|
Whether an adaptive Switch should be created based on the target platform.
|
|
143
143
|
|
|
144
|
-
On iOS and macOS, a [`CupertinoSwitch`][flet.
|
|
144
|
+
On iOS and macOS, a [`CupertinoSwitch`][flet.] is created,
|
|
145
145
|
which has matching functionality and presentation as `Switch`,
|
|
146
146
|
and the graphics as expected on iOS. On other platforms,
|
|
147
147
|
a Material Switch is created.
|
|
@@ -165,7 +165,7 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
165
165
|
"""
|
|
166
166
|
The color for the switch's
|
|
167
167
|
Material in various
|
|
168
|
-
[`ControlState`][flet.
|
|
168
|
+
[`ControlState`][flet.] states.
|
|
169
169
|
|
|
170
170
|
The following states are supported: `ControlState.PRESSED`,
|
|
171
171
|
`ControlState.SELECTED`, `ControlState.HOVERED`, `ControlState.FOCUSED` and
|
|
@@ -175,7 +175,7 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
175
175
|
track_outline_color: Optional[ControlStateValue[ColorValue]] = None
|
|
176
176
|
"""
|
|
177
177
|
The outline color of this switch's
|
|
178
|
-
track in various [`ControlState`][flet.
|
|
178
|
+
track in various [`ControlState`][flet.]
|
|
179
179
|
states.
|
|
180
180
|
|
|
181
181
|
The following states are supported: `ControlState.SELECTED`, `
|
|
@@ -186,7 +186,7 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
186
186
|
track_outline_width: Optional[ControlStateValue[Optional[Number]]] = None
|
|
187
187
|
"""
|
|
188
188
|
The outline width of this switch's track in all or specific
|
|
189
|
-
[`ControlState`][flet.
|
|
189
|
+
[`ControlState`][flet.] states.
|
|
190
190
|
|
|
191
191
|
The following states are supported: `ControlState.SELECTED`,
|
|
192
192
|
`ControlState.HOVERED`, `ControlState.DISABLED`,
|
|
@@ -204,7 +204,7 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
204
204
|
The amount of space to surround the child inside the bounds of the Switch.
|
|
205
205
|
|
|
206
206
|
Defaults to horizontal padding of 4 pixels. If
|
|
207
|
-
[`Theme.use_material3`][flet.
|
|
207
|
+
[`Theme.use_material3`][flet.] is false, then there is no
|
|
208
208
|
padding by default.
|
|
209
209
|
"""
|
|
210
210
|
|