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
|
@@ -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
|
|
flet/controls/material/tabs.py
CHANGED
|
@@ -40,31 +40,31 @@ __all__ = [
|
|
|
40
40
|
|
|
41
41
|
class TabAlignment(Enum):
|
|
42
42
|
"""
|
|
43
|
-
Defines how tabs are aligned horizontally in a [`Tabs`][flet.
|
|
43
|
+
Defines how tabs are aligned horizontally in a [`Tabs`][flet.].
|
|
44
44
|
"""
|
|
45
45
|
|
|
46
46
|
START = "start"
|
|
47
47
|
"""
|
|
48
|
-
If [`TabBar.scrollable`][flet.
|
|
49
|
-
tabs are aligned to the start of the [`TabBar`][flet.
|
|
48
|
+
If [`TabBar.scrollable`][flet.] is `True`,
|
|
49
|
+
tabs are aligned to the start of the [`TabBar`][flet.].
|
|
50
50
|
"""
|
|
51
51
|
|
|
52
52
|
START_OFFSET = "startOffset"
|
|
53
53
|
"""
|
|
54
|
-
If [`TabBar.scrollable`][flet.
|
|
54
|
+
If [`TabBar.scrollable`][flet.] is `True`,
|
|
55
55
|
tabs are aligned to the start of the
|
|
56
|
-
[`TabBar`][flet.
|
|
56
|
+
[`TabBar`][flet.] with an offset of `52.0` pixels.
|
|
57
57
|
"""
|
|
58
58
|
|
|
59
59
|
FILL = "fill"
|
|
60
60
|
"""
|
|
61
|
-
If [`TabBar.scrollable`][flet.
|
|
62
|
-
tabs are stretched to fill the [`TabBar`][flet.
|
|
61
|
+
If [`TabBar.scrollable`][flet.] is `False`,
|
|
62
|
+
tabs are stretched to fill the [`TabBar`][flet.].
|
|
63
63
|
"""
|
|
64
64
|
|
|
65
65
|
CENTER = "center"
|
|
66
66
|
"""
|
|
67
|
-
Tabs are aligned to the center of the [`TabBar`][flet.
|
|
67
|
+
Tabs are aligned to the center of the [`TabBar`][flet.].
|
|
68
68
|
"""
|
|
69
69
|
|
|
70
70
|
|
|
@@ -110,7 +110,7 @@ class TabBarHoverEvent(Event["TabBar"]):
|
|
|
110
110
|
hovering: bool
|
|
111
111
|
"""
|
|
112
112
|
Whether a pointer has entered (`True`) or exited (`False`) the tab bar
|
|
113
|
-
at [`index`][
|
|
113
|
+
at [`index`][(c).].
|
|
114
114
|
"""
|
|
115
115
|
|
|
116
116
|
index: int
|
|
@@ -132,10 +132,10 @@ class UnderlineTabIndicator:
|
|
|
132
132
|
"""
|
|
133
133
|
Locates the selected tab's underline relative to the tab's boundary.
|
|
134
134
|
|
|
135
|
-
The [`TabBar.indicator_size`][flet.
|
|
135
|
+
The [`TabBar.indicator_size`][flet.] property can be used
|
|
136
136
|
to define the tab indicator's bounds in terms of its (centered) tab control with
|
|
137
|
-
[`TabBarIndicatorSize.LABEL`][flet.
|
|
138
|
-
with [`TabBarIndicatorSize.TAB`][flet.
|
|
137
|
+
[`TabBarIndicatorSize.LABEL`][flet.], or the entire tab
|
|
138
|
+
with [`TabBarIndicatorSize.TAB`][flet.].
|
|
139
139
|
"""
|
|
140
140
|
|
|
141
141
|
border_radius: Optional[BorderRadiusValue] = None
|
|
@@ -155,7 +155,7 @@ class Tabs(LayoutControl, AdaptiveControl):
|
|
|
155
155
|
on text headers to articulate the different sections of content.
|
|
156
156
|
|
|
157
157
|
Raises:
|
|
158
|
-
ValueError: If [`length`][
|
|
158
|
+
ValueError: If [`length`][(c).] is negative.
|
|
159
159
|
IndexError: If [`selected_index`][(c).] is not in the range
|
|
160
160
|
`[-length, length - 1]`.
|
|
161
161
|
"""
|
|
@@ -172,8 +172,8 @@ class Tabs(LayoutControl, AdaptiveControl):
|
|
|
172
172
|
Typically greater than one.
|
|
173
173
|
|
|
174
174
|
Note:
|
|
175
|
-
Must match the length of both [`TabBar.tabs`][flet.
|
|
176
|
-
and [`TabBarView.controls`][flet.
|
|
175
|
+
Must match the length of both [`TabBar.tabs`][flet.]
|
|
176
|
+
and [`TabBarView.controls`][flet.]. Don't forget to update
|
|
177
177
|
it when adding/removing tabs.
|
|
178
178
|
"""
|
|
179
179
|
|
|
@@ -187,11 +187,10 @@ class Tabs(LayoutControl, AdaptiveControl):
|
|
|
187
187
|
Note:
|
|
188
188
|
- Must be in range `[-length, length - 1]`.
|
|
189
189
|
- Changing the value of this property will internally trigger
|
|
190
|
-
[`move_to`][
|
|
191
|
-
[`
|
|
192
|
-
[`Curve.EASE`][flet.AnimationCurve.EASE] animation curve. To specify
|
|
190
|
+
[`move_to`][(c).] with [`animation_duration`][(c).] and
|
|
191
|
+
[`AnimationCurve.EASE`][flet.] animation curve. To specify
|
|
193
192
|
a different animation curve or duration for this particular change,
|
|
194
|
-
use [`move_to`][
|
|
193
|
+
use [`move_to`][(c).] directly.
|
|
195
194
|
"""
|
|
196
195
|
|
|
197
196
|
animation_duration: DurationValue = field(
|
|
@@ -204,9 +203,9 @@ class Tabs(LayoutControl, AdaptiveControl):
|
|
|
204
203
|
|
|
205
204
|
on_change: Optional[ControlEventHandler["Tabs"]] = None
|
|
206
205
|
"""
|
|
207
|
-
Called when [`selected_index`][
|
|
206
|
+
Called when [`selected_index`][(c).] changes.
|
|
208
207
|
|
|
209
|
-
The [`data`][flet.Event.
|
|
208
|
+
The [`data`][flet.Event.] property of the event handler argument
|
|
210
209
|
contains the index of the selected tab.
|
|
211
210
|
"""
|
|
212
211
|
|
|
@@ -231,8 +230,8 @@ class Tabs(LayoutControl, AdaptiveControl):
|
|
|
231
230
|
"""
|
|
232
231
|
Selects the tab at the given `index`.
|
|
233
232
|
|
|
234
|
-
Additionally, it triggers [`on_change`][
|
|
235
|
-
[`selected_index`][
|
|
233
|
+
Additionally, it triggers [`on_change`][(c).] event and updates
|
|
234
|
+
[`selected_index`][(c).].
|
|
236
235
|
|
|
237
236
|
Note:
|
|
238
237
|
If `index` is negative, it is interpreted as a Python-style negative index
|
|
@@ -244,7 +243,7 @@ class Tabs(LayoutControl, AdaptiveControl):
|
|
|
244
243
|
`[-length, length - 1]`.
|
|
245
244
|
animation_curve: The curve to apply to the animation.
|
|
246
245
|
animation_duration: The duration of the animation. If `None` (the default),
|
|
247
|
-
[`Tabs.animation_duration`][flet.
|
|
246
|
+
[`Tabs.animation_duration`][flet.] will be used.
|
|
248
247
|
|
|
249
248
|
Raises:
|
|
250
249
|
IndexError: If the `index` is outside the range `[-length, length - 1]`.
|
|
@@ -281,23 +280,23 @@ class TabBarView(LayoutControl, AdaptiveControl):
|
|
|
281
280
|
|
|
282
281
|
Note:
|
|
283
282
|
The length of [`controls`][(c).] must be the same as the
|
|
284
|
-
[`length`][flet.Tabs.
|
|
283
|
+
[`length`][flet.Tabs.] property of the ancestor [`Tabs`][flet.].
|
|
285
284
|
"""
|
|
286
285
|
|
|
287
286
|
controls: list[Control]
|
|
288
287
|
"""
|
|
289
288
|
A list of controls, where each control represents the
|
|
290
289
|
content of a corresponding tab. So, a control at index `i` in this list is
|
|
291
|
-
displayed when the [`Tab`][flet.
|
|
290
|
+
displayed when the [`Tab`][flet.] at index `i` is selected.
|
|
292
291
|
|
|
293
292
|
Note:
|
|
294
293
|
The length of this list must be equal to the number of tabs specified in an
|
|
295
|
-
ancestor [`Tabs`][flet.
|
|
294
|
+
ancestor [`Tabs`][flet.] control.
|
|
296
295
|
"""
|
|
297
296
|
|
|
298
297
|
clip_behavior: ClipBehavior = ClipBehavior.HARD_EDGE
|
|
299
298
|
"""
|
|
300
|
-
Defines how the [`controls`][
|
|
299
|
+
Defines how the [`controls`][(c).] will be clipped.
|
|
301
300
|
"""
|
|
302
301
|
|
|
303
302
|
viewport_fraction: Number = 1.0
|
|
@@ -327,7 +326,7 @@ class TabBar(LayoutControl, AdaptiveControl):
|
|
|
327
326
|
"""
|
|
328
327
|
A list of controls.
|
|
329
328
|
|
|
330
|
-
Typically [`Tab`][flet.
|
|
329
|
+
Typically [`Tab`][flet.]s.
|
|
331
330
|
"""
|
|
332
331
|
|
|
333
332
|
scrollable: bool = True
|
|
@@ -344,29 +343,29 @@ class TabBar(LayoutControl, AdaptiveControl):
|
|
|
344
343
|
Specifies the horizontal alignment of the tabs within this tab bar.
|
|
345
344
|
|
|
346
345
|
If this is `None`, then the value of
|
|
347
|
-
[`TabBarTheme.tab_alignment`][flet.
|
|
348
|
-
If [`TabBarTheme.tab_alignment`][flet.
|
|
349
|
-
[`Theme.use_material3`][flet.
|
|
346
|
+
[`TabBarTheme.tab_alignment`][flet.] is used.
|
|
347
|
+
If [`TabBarTheme.tab_alignment`][flet.] is `None` and
|
|
348
|
+
[`Theme.use_material3`][flet.] is `True`,
|
|
350
349
|
then [TabAlignment.START_OFFSET][flet.TabAlignment.START_OFFSET] is used if
|
|
351
|
-
[`scrollable`][
|
|
352
|
-
otherwise [`TabAlignment.FILL`][flet.
|
|
350
|
+
[`scrollable`][(c).] is `True`,
|
|
351
|
+
otherwise [`TabAlignment.FILL`][flet.] is used.
|
|
353
352
|
|
|
354
|
-
If [`TabBarTheme.tab_alignment`][flet.
|
|
355
|
-
and [`Theme.use_material3`][flet.
|
|
356
|
-
then [`TabAlignment.CENTER`][flet.
|
|
357
|
-
[`scrollable`][
|
|
358
|
-
otherwise [`TabAlignment.FILL`][flet.
|
|
353
|
+
If [`TabBarTheme.tab_alignment`][flet.] is `None`
|
|
354
|
+
and [`Theme.use_material3`][flet.] is `False`,
|
|
355
|
+
then [`TabAlignment.CENTER`][flet.] is used if
|
|
356
|
+
[`scrollable`][(c).] is `True`,
|
|
357
|
+
otherwise [`TabAlignment.FILL`][flet.] is used.
|
|
359
358
|
|
|
360
359
|
Note:
|
|
361
|
-
- If [`scrollable`][
|
|
362
|
-
[`tab_alignment`][
|
|
363
|
-
[`TabAlignment.FILL`][flet.
|
|
364
|
-
[`TabAlignment.CENTER`][flet.
|
|
365
|
-
- If [`scrollable`][
|
|
366
|
-
[`tab_alignment`][
|
|
367
|
-
[`TabAlignment.START`][flet.
|
|
368
|
-
[`TabAlignment.START_OFFSET`][flet.
|
|
369
|
-
or [`TabAlignment.CENTER`][flet.
|
|
360
|
+
- If [`scrollable`][(c).] is `False`, then
|
|
361
|
+
[`tab_alignment`][(c).] must be either
|
|
362
|
+
[`TabAlignment.FILL`][flet.] or
|
|
363
|
+
[`TabAlignment.CENTER`][flet.].
|
|
364
|
+
- If [`scrollable`][(c).] is `True`, then
|
|
365
|
+
[`tab_alignment`][(c).] must be
|
|
366
|
+
[`TabAlignment.START`][flet.],
|
|
367
|
+
[`TabAlignment.START_OFFSET`][flet.]
|
|
368
|
+
or [`TabAlignment.CENTER`][flet.].
|
|
370
369
|
"""
|
|
371
370
|
|
|
372
371
|
divider_color: Optional[ColorValue] = None
|
|
@@ -379,24 +378,24 @@ class TabBar(LayoutControl, AdaptiveControl):
|
|
|
379
378
|
The color of the indicator(line that appears below the selected tab).
|
|
380
379
|
|
|
381
380
|
Note:
|
|
382
|
-
Will be ignored if [`indicator`][
|
|
383
|
-
[`TabBarTheme.indicator`][flet.
|
|
381
|
+
Will be ignored if [`indicator`][(c).] or
|
|
382
|
+
[`TabBarTheme.indicator`][flet.] is not `None`.
|
|
384
383
|
"""
|
|
385
384
|
|
|
386
385
|
indicator: Optional[UnderlineTabIndicator] = None
|
|
387
386
|
"""
|
|
388
387
|
Defines the appearance of the selected tab indicator.
|
|
389
388
|
|
|
390
|
-
If this or [`TabBarTheme.indicator`][flet.
|
|
391
|
-
[`indicator_color`][
|
|
392
|
-
[`indicator_thickness`][
|
|
389
|
+
If this or [`TabBarTheme.indicator`][flet.] is not `None`,
|
|
390
|
+
[`indicator_color`][(c).] and
|
|
391
|
+
[`indicator_thickness`][(c).] properties are ignored.
|
|
393
392
|
|
|
394
393
|
The indicator's size is based on the tab's bounds. If
|
|
395
|
-
[`indicator_size`][
|
|
396
|
-
is [`TabBarIndicatorSize.TAB`][flet.
|
|
394
|
+
[`indicator_size`][(c).]
|
|
395
|
+
is [`TabBarIndicatorSize.TAB`][flet.],
|
|
397
396
|
the tab's bounds are as wide as the space occupied by the tab in the tab bar.
|
|
398
|
-
If [`indicator_size`][
|
|
399
|
-
[`TabBarIndicatorSize.LABEL`][flet.
|
|
397
|
+
If [`indicator_size`][(c).] is
|
|
398
|
+
[`TabBarIndicatorSize.LABEL`][flet.],
|
|
400
399
|
then the tab's bounds are only as wide as the tab control itself.
|
|
401
400
|
"""
|
|
402
401
|
|
|
@@ -406,14 +405,14 @@ class TabBar(LayoutControl, AdaptiveControl):
|
|
|
406
405
|
|
|
407
406
|
The size of the selected tab indicator is defined relative to the
|
|
408
407
|
tab's overall bounds if `indicator_size` is
|
|
409
|
-
[`TabBarIndicatorSize.TAB`][flet.
|
|
408
|
+
[`TabBarIndicatorSize.TAB`][flet.]
|
|
410
409
|
(the default) or relative to the bounds of the tab's control if
|
|
411
|
-
`indicator_size` is [`TabBarIndicatorSize.LABEL`][flet.
|
|
410
|
+
`indicator_size` is [`TabBarIndicatorSize.LABEL`][flet.].
|
|
412
411
|
|
|
413
412
|
The selected tab's location appearance can be refined further with
|
|
414
|
-
the [`indicator_color`][
|
|
415
|
-
[`indicator_thickness`][
|
|
416
|
-
and [`indicator`][
|
|
413
|
+
the [`indicator_color`][(c).],
|
|
414
|
+
[`indicator_thickness`][(c).],
|
|
415
|
+
and [`indicator`][(c).] properties.
|
|
417
416
|
"""
|
|
418
417
|
|
|
419
418
|
indicator_animation: Optional[TabIndicatorAnimation] = None
|
|
@@ -421,12 +420,12 @@ class TabBar(LayoutControl, AdaptiveControl):
|
|
|
421
420
|
Specifies the animation behavior of the tab indicator.
|
|
422
421
|
|
|
423
422
|
If this is `None`, then the value of
|
|
424
|
-
[`TabBarTheme.indicator_animation`][flet.
|
|
423
|
+
[`TabBarTheme.indicator_animation`][flet.] is used.
|
|
425
424
|
If that is also `None`, then the tab indicator will animate linearly if the
|
|
426
|
-
[`indicator_size`][
|
|
427
|
-
[`TabBarIndicatorSize.TAB`][flet.
|
|
428
|
-
with an elastic effect if the [`indicator_size`][
|
|
429
|
-
[`TabBarIndicatorSize.LABEL`][flet.
|
|
425
|
+
[`indicator_size`][(c).] is
|
|
426
|
+
[`TabBarIndicatorSize.TAB`][flet.], otherwise it will animate
|
|
427
|
+
with an elastic effect if the [`indicator_size`][(c).] is
|
|
428
|
+
[`TabBarIndicatorSize.LABEL`][flet.].
|
|
430
429
|
"""
|
|
431
430
|
|
|
432
431
|
secondary: bool = False
|
|
@@ -465,7 +464,7 @@ class TabBar(LayoutControl, AdaptiveControl):
|
|
|
465
464
|
overlay_color: Optional[ControlStateValue[ColorValue]] = None
|
|
466
465
|
"""
|
|
467
466
|
Defines the ink response focus, hover, and splash
|
|
468
|
-
colors in various [`ControlState`][flet.
|
|
467
|
+
colors in various [`ControlState`][flet.] states.
|
|
469
468
|
|
|
470
469
|
The following states are supported: `ControlState.PRESSED`,
|
|
471
470
|
`ControlState.HOVERED` and
|
|
@@ -477,7 +476,7 @@ class TabBar(LayoutControl, AdaptiveControl):
|
|
|
477
476
|
The height of the divider.
|
|
478
477
|
|
|
479
478
|
If `None`, defaults to
|
|
480
|
-
[`TabBarTheme.divider_height`][flet.
|
|
479
|
+
[`TabBarTheme.divider_height`][flet.]. If this is also
|
|
481
480
|
`None`, `1.0` will be used.
|
|
482
481
|
"""
|
|
483
482
|
|
|
@@ -486,8 +485,8 @@ class TabBar(LayoutControl, AdaptiveControl):
|
|
|
486
485
|
The thickness of the indicator. Value must be greater than zero.
|
|
487
486
|
|
|
488
487
|
Note:
|
|
489
|
-
Will be ignored if [`indicator`][
|
|
490
|
-
[`TabBarTheme.indicator`][flet.
|
|
488
|
+
Will be ignored if [`indicator`][(c).] or
|
|
489
|
+
[`TabBarTheme.indicator`][flet.] is not `None`.
|
|
491
490
|
"""
|
|
492
491
|
|
|
493
492
|
enable_feedback: Optional[bool] = None
|
|
@@ -520,13 +519,13 @@ class TabBar(LayoutControl, AdaptiveControl):
|
|
|
520
519
|
"""
|
|
521
520
|
Called when a tab is clicked.
|
|
522
521
|
|
|
523
|
-
The [`data`][flet.Event.
|
|
522
|
+
The [`data`][flet.Event.] property of the event handler argument
|
|
524
523
|
contains the index of the clicked tab.
|
|
525
524
|
"""
|
|
526
525
|
|
|
527
526
|
on_hover: Optional[EventHandler[TabBarHoverEvent]] = None
|
|
528
527
|
"""
|
|
529
|
-
Called when a tab's (from [`tabs`][
|
|
528
|
+
Called when a tab's (from [`tabs`][(c).]) hover state in the
|
|
530
529
|
tab bar changes.
|
|
531
530
|
|
|
532
531
|
When hover is moved from one tab directly to another, this will be called
|
|
@@ -558,7 +557,7 @@ class TabBar(LayoutControl, AdaptiveControl):
|
|
|
558
557
|
@control("Tab")
|
|
559
558
|
class Tab(AdaptiveControl):
|
|
560
559
|
"""
|
|
561
|
-
A Material Design [`TabBar`][flet.
|
|
560
|
+
A Material Design [`TabBar`][flet.] tab.
|
|
562
561
|
|
|
563
562
|
Raises:
|
|
564
563
|
AssertionError: If both [`label`][(c).] and [`icon`][(c).] are not set.
|
|
@@ -579,7 +578,7 @@ class Tab(AdaptiveControl):
|
|
|
579
578
|
The height of the tab.
|
|
580
579
|
|
|
581
580
|
If `None`, it will be calculated based on the content of the Tab. When
|
|
582
|
-
[`icon`][
|
|
581
|
+
[`icon`][(c).] is not `None` along with [`label`][(c).],
|
|
583
582
|
the default `height` is `72.0` pixels. Without an `icon`,
|
|
584
583
|
the `height` is 46.0 pixels.
|
|
585
584
|
|
|
@@ -590,11 +589,11 @@ class Tab(AdaptiveControl):
|
|
|
590
589
|
"""
|
|
591
590
|
The margin added around the tab's icon.
|
|
592
591
|
|
|
593
|
-
Only useful when used in combination with [`icon`][
|
|
594
|
-
and [`label`][
|
|
592
|
+
Only useful when used in combination with [`icon`][(c).],
|
|
593
|
+
and [`label`][(c).] is not `None`.
|
|
595
594
|
|
|
596
595
|
Defaults to `2` pixels of bottom margin.
|
|
597
|
-
If [`Theme.use_material3`][flet.
|
|
596
|
+
If [`Theme.use_material3`][flet.] is `False`,
|
|
598
597
|
then defaults to `10` pixels of bottom margin.
|
|
599
598
|
"""
|
|
600
599
|
|
|
@@ -56,7 +56,7 @@ class TextButton(LayoutControl, AdaptiveControl):
|
|
|
56
56
|
"""
|
|
57
57
|
The URL to open when this button is clicked.
|
|
58
58
|
|
|
59
|
-
Additionally, if [`on_click`][
|
|
59
|
+
Additionally, if [`on_click`][(c).] event callback is
|
|
60
60
|
provided, it is fired after that.
|
|
61
61
|
"""
|
|
62
62
|
|
|
@@ -79,7 +79,7 @@ class TextButton(LayoutControl, AdaptiveControl):
|
|
|
79
79
|
"""
|
|
80
80
|
Called when a mouse pointer enters or exists this button's response area.
|
|
81
81
|
|
|
82
|
-
The [`data`][flet.Event.
|
|
82
|
+
The [`data`][flet.Event.] property of event object is `True` when cursor
|
|
83
83
|
enters and `False` when it exits.
|
|
84
84
|
"""
|
|
85
85
|
|
|
@@ -19,11 +19,11 @@ from flet.controls.types import (
|
|
|
19
19
|
)
|
|
20
20
|
|
|
21
21
|
__all__ = [
|
|
22
|
-
"TextField",
|
|
23
|
-
"KeyboardType",
|
|
24
|
-
"TextCapitalization",
|
|
25
22
|
"InputFilter",
|
|
23
|
+
"KeyboardType",
|
|
26
24
|
"NumbersOnlyInputFilter",
|
|
25
|
+
"TextCapitalization",
|
|
26
|
+
"TextField",
|
|
27
27
|
"TextOnlyInputFilter",
|
|
28
28
|
]
|
|
29
29
|
|
|
@@ -142,9 +142,7 @@ class TextField(FormFieldControl, AdaptiveControl):
|
|
|
142
142
|
|
|
143
143
|
keyboard_type: KeyboardType = KeyboardType.TEXT
|
|
144
144
|
"""
|
|
145
|
-
The type of keyboard to use for editing the text.
|
|
146
|
-
[`KeyboardType`][flet.KeyboardType] and defaults
|
|
147
|
-
to `KeyboardType.TEXT`.
|
|
145
|
+
The type of keyboard to use for editing the text.
|
|
148
146
|
"""
|
|
149
147
|
|
|
150
148
|
multiline: bool = False
|
|
@@ -64,7 +64,7 @@ class Tooltip:
|
|
|
64
64
|
"""
|
|
65
65
|
The vertical gap between the control and the displayed tooltip.
|
|
66
66
|
|
|
67
|
-
When [`prefer_below`][
|
|
67
|
+
When [`prefer_below`][(c).] is set to `True`
|
|
68
68
|
and tooltips have sufficient space to
|
|
69
69
|
display themselves, this property defines how much vertical space
|
|
70
70
|
tooltips will position themselves under their corresponding controls.
|
|
@@ -76,7 +76,7 @@ class Tooltip:
|
|
|
76
76
|
"""
|
|
77
77
|
The empty space that surrounds the tooltip.
|
|
78
78
|
|
|
79
|
-
If `None`, [`TooltipTheme.margin`][flet.
|
|
79
|
+
If `None`, [`TooltipTheme.margin`][flet.] is used.
|
|
80
80
|
If that's is also `None`, defaults to `Margin.all(0.0)`.
|
|
81
81
|
"""
|
|
82
82
|
|
|
@@ -97,7 +97,7 @@ class Tooltip:
|
|
|
97
97
|
|
|
98
98
|
text_style: Optional[TextStyle] = None
|
|
99
99
|
"""
|
|
100
|
-
The [`TextStyle`][flet.
|
|
100
|
+
The [`TextStyle`][flet.] to use for the
|
|
101
101
|
message of the tooltip.
|
|
102
102
|
"""
|
|
103
103
|
|
|
@@ -105,8 +105,8 @@ class Tooltip:
|
|
|
105
105
|
"""
|
|
106
106
|
How the message of the tooltip is aligned horizontally.
|
|
107
107
|
|
|
108
|
-
If `None`, [`TooltipTheme.text_align`][flet.
|
|
109
|
-
If that's is also `None`, defaults to [`TextAlign.START`][flet.
|
|
108
|
+
If `None`, [`TooltipTheme.text_align`][flet.] is used.
|
|
109
|
+
If that's is also `None`, defaults to [`TextAlign.START`][flet.].
|
|
110
110
|
"""
|
|
111
111
|
|
|
112
112
|
prefer_below: Optional[bool] = None
|
|
@@ -116,18 +116,18 @@ class Tooltip:
|
|
|
116
116
|
If there is insufficient space to display the tooltip in the preferred
|
|
117
117
|
direction, the tooltip will be displayed in the opposite direction.
|
|
118
118
|
|
|
119
|
-
If `None`, [`TooltipTheme.prefer_below`][flet.
|
|
119
|
+
If `None`, [`TooltipTheme.prefer_below`][flet.] is used.
|
|
120
120
|
If that's is also `None`, defaults to `True`.
|
|
121
121
|
"""
|
|
122
122
|
|
|
123
123
|
show_duration: Optional[DurationValue] = None
|
|
124
124
|
"""
|
|
125
125
|
The length of time that the tooltip will be shown after a long press is released
|
|
126
|
-
(if triggerMode is [`TooltipTriggerMode.LONG_PRESS`][flet.
|
|
127
|
-
(if triggerMode is [`TooltipTriggerMode.TAP`][flet.
|
|
126
|
+
(if triggerMode is [`TooltipTriggerMode.LONG_PRESS`][flet.]) or a tap is released
|
|
127
|
+
(if triggerMode is [`TooltipTriggerMode.TAP`][flet.]).
|
|
128
128
|
This property does not affect mouse pointer devices.
|
|
129
129
|
|
|
130
|
-
If `None`, [`TooltipTheme.show_duration`][flet.
|
|
130
|
+
If `None`, [`TooltipTheme.show_duration`][flet.] is used.
|
|
131
131
|
If that's is also `None`, defaults to `1.5` seconds for long press and tap released
|
|
132
132
|
"""
|
|
133
133
|
|
|
@@ -136,7 +136,7 @@ class Tooltip:
|
|
|
136
136
|
The length of time, in milliseconds, that a pointer must hover over a
|
|
137
137
|
tooltip's control before the tooltip will be shown.
|
|
138
138
|
|
|
139
|
-
If `None`, [`TooltipTheme.wait_duration`][flet.
|
|
139
|
+
If `None`, [`TooltipTheme.wait_duration`][flet.] is used.
|
|
140
140
|
If that's is also `None`, defaults to `100` milliseconds.
|
|
141
141
|
"""
|
|
142
142
|
|
|
@@ -145,7 +145,7 @@ class Tooltip:
|
|
|
145
145
|
The length of time that the tooltip will be shown after a
|
|
146
146
|
long press is released or a tap is released or mouse pointer exits the control.
|
|
147
147
|
|
|
148
|
-
If `None`, [`TooltipTheme.exit_duration`][flet.
|
|
148
|
+
If `None`, [`TooltipTheme.exit_duration`][flet.] is used.
|
|
149
149
|
If that's is also `None`, defaults to 0 milliseconds - no delay.
|
|
150
150
|
"""
|
|
151
151
|
|
|
@@ -163,9 +163,9 @@ class Tooltip:
|
|
|
163
163
|
"""
|
|
164
164
|
The mode of the tooltip's trigger.
|
|
165
165
|
|
|
166
|
-
If `None`, [`TooltipTheme.trigger_mode`][flet.
|
|
166
|
+
If `None`, [`TooltipTheme.trigger_mode`][flet.] is used.
|
|
167
167
|
If that's is also `None`, defaults to
|
|
168
|
-
[`TooltipTriggerMode.LONG_PRESS`][flet.
|
|
168
|
+
[`TooltipTriggerMode.LONG_PRESS`][flet.].
|
|
169
169
|
"""
|
|
170
170
|
|
|
171
171
|
mouse_cursor: Optional[MouseCursor] = None
|
|
@@ -177,8 +177,9 @@ class Tooltip:
|
|
|
177
177
|
"""
|
|
178
178
|
Defines the constraints on the size of this tooltip.
|
|
179
179
|
|
|
180
|
-
If `None`, [`TooltipTheme.size_constraints`][flet.
|
|
181
|
-
If that's is also `None`, then a default value will be picked
|
|
180
|
+
If `None`, [`TooltipTheme.size_constraints`][flet.] is used.
|
|
181
|
+
If that's is also `None`, then a default value will be picked
|
|
182
|
+
based on the current platform:
|
|
182
183
|
|
|
183
184
|
- on desktop platforms: `BoxConstraints(min_height=24.0)`
|
|
184
185
|
- on mobile platforms: `BoxConstraints(min_height=32.0)`
|