flet 0.70.0.dev5623__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 +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/flet_test_app.py +4 -4
- flet/version.py +1 -1
- {flet-0.70.0.dev5623.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.dev5623.dist-info/RECORD +0 -238
- {flet-0.70.0.dev5623.dist-info → flet-0.70.0.dev5771.dist-info}/WHEEL +0 -0
- {flet-0.70.0.dev5623.dist-info → flet-0.70.0.dev5771.dist-info}/entry_points.txt +0 -0
- {flet-0.70.0.dev5623.dist-info → flet-0.70.0.dev5771.dist-info}/top_level.txt +0 -0
|
@@ -20,31 +20,31 @@ class AppBar(AdaptiveControl):
|
|
|
20
20
|
A material design app bar.
|
|
21
21
|
|
|
22
22
|
Raises:
|
|
23
|
-
AssertionError: If [`elevation`][(c).] or [`elevation_on_scroll`][(c).]
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
AssertionError: If [`elevation`][(c).] or [`elevation_on_scroll`][(c).]
|
|
24
|
+
is negative.
|
|
25
|
+
AssertionError: If [`toolbar_opacity`][(c).] is not between `0.0`
|
|
26
|
+
and `1.0` inclusive.
|
|
27
|
+
"""
|
|
26
28
|
|
|
27
29
|
leading: Optional[Control] = None
|
|
28
30
|
"""
|
|
29
|
-
A control to display before the toolbar's [`title`][
|
|
31
|
+
A control to display before the toolbar's [`title`][(c).].
|
|
30
32
|
|
|
31
|
-
Typically an [`Icon`][flet.
|
|
33
|
+
Typically an [`Icon`][flet.] or [`IconButton`][flet.] control.
|
|
32
34
|
"""
|
|
33
35
|
|
|
34
36
|
leading_width: Optional[Number] = None
|
|
35
37
|
"""
|
|
36
|
-
Defines the width of the [`leading`][
|
|
38
|
+
Defines the width of the [`leading`][(c).] control.
|
|
37
39
|
"""
|
|
38
40
|
|
|
39
41
|
automatically_imply_leading: bool = True
|
|
40
42
|
"""
|
|
41
|
-
Whether we should try to imply the [`leading`][
|
|
42
|
-
if it is `None`.
|
|
43
|
+
Whether we should try to imply the [`leading`][(c).] control if it is `None`.
|
|
43
44
|
|
|
44
45
|
- If `True` and `leading` is `None`, this app bar will automatically determine
|
|
45
|
-
|
|
46
|
-
- If `False` and `leading` is `None`, the space is allocated to the
|
|
47
|
-
[`title`][flet.AppBar.title].
|
|
46
|
+
an appropriate leading control.
|
|
47
|
+
- If `False` and `leading` is `None`, the space is allocated to the [`title`][(c).].
|
|
48
48
|
- If a `leading` control is provided, this parameter has no effect.
|
|
49
49
|
"""
|
|
50
50
|
|
|
@@ -52,22 +52,21 @@ class AppBar(AdaptiveControl):
|
|
|
52
52
|
"""
|
|
53
53
|
The primary Control displayed in this app bar.
|
|
54
54
|
|
|
55
|
-
Typically a [`Text`][flet.
|
|
55
|
+
Typically a [`Text`][flet.]
|
|
56
56
|
control that contains a description of the current contents of this app.
|
|
57
57
|
|
|
58
58
|
Note:
|
|
59
|
-
If [`AppBar.adaptive=True`][
|
|
60
|
-
an iOS or macOS device, this [`title`][
|
|
61
|
-
automatically centered, independent of the value of
|
|
62
|
-
[`center_title`][flet.AppBar.center_title].
|
|
59
|
+
If [`AppBar.adaptive=True`][(c).adaptive] and this app is opened on
|
|
60
|
+
an iOS or macOS device, this [`title`][(c).] control will be
|
|
61
|
+
automatically centered, independent of the value of [`center_title`][(c).].
|
|
63
62
|
"""
|
|
64
63
|
|
|
65
64
|
center_title: Optional[bool] = None
|
|
66
65
|
"""
|
|
67
|
-
Whether the [`title`][
|
|
66
|
+
Whether the [`title`][(c).] should be centered.
|
|
68
67
|
|
|
69
|
-
Default value is defined by [`AppBarTheme.center_title`][flet.
|
|
70
|
-
"""
|
|
68
|
+
Default value is defined by [`AppBarTheme.center_title`][flet.]
|
|
69
|
+
"""
|
|
71
70
|
|
|
72
71
|
toolbar_height: Optional[Number] = None
|
|
73
72
|
"""
|
|
@@ -76,17 +75,17 @@ class AppBar(AdaptiveControl):
|
|
|
76
75
|
|
|
77
76
|
color: Optional[ColorValue] = None
|
|
78
77
|
"""
|
|
79
|
-
The default color for [`Text`][flet.
|
|
80
|
-
and [`Icon`][flet.
|
|
78
|
+
The default color for [`Text`][flet.]
|
|
79
|
+
and [`Icon`][flet.] controls within this app bar.
|
|
81
80
|
|
|
82
|
-
Default color is defined by [`AppBarTheme.color`][flet.
|
|
81
|
+
Default color is defined by [`AppBarTheme.color`][flet.]
|
|
83
82
|
"""
|
|
84
83
|
|
|
85
84
|
bgcolor: Optional[ColorValue] = None
|
|
86
85
|
"""
|
|
87
86
|
The fill color to use for this app bar.
|
|
88
87
|
|
|
89
|
-
Default color is defined by [`AppBarTheme.bgcolor`][flet.
|
|
88
|
+
Default color is defined by [`AppBarTheme.bgcolor`][flet.]
|
|
90
89
|
"""
|
|
91
90
|
|
|
92
91
|
elevation: Optional[Number] = None
|
|
@@ -95,7 +94,7 @@ class AppBar(AdaptiveControl):
|
|
|
95
94
|
|
|
96
95
|
Note:
|
|
97
96
|
This effect is only visible when using the Material 2 design
|
|
98
|
-
(when [`Theme.use_material3
|
|
97
|
+
(when [`Theme.use_material3`][flet.] is `False`).
|
|
99
98
|
"""
|
|
100
99
|
|
|
101
100
|
elevation_on_scroll: Optional[Number] = None
|
|
@@ -107,7 +106,7 @@ class AppBar(AdaptiveControl):
|
|
|
107
106
|
"""
|
|
108
107
|
The color of the shadow below this app bar.
|
|
109
108
|
|
|
110
|
-
A shadow is only visible and displayed if the [`elevation`][
|
|
109
|
+
A shadow is only visible and displayed if the [`elevation`][(c).]
|
|
111
110
|
is greater than zero.
|
|
112
111
|
"""
|
|
113
112
|
|
|
@@ -120,9 +119,8 @@ class AppBar(AdaptiveControl):
|
|
|
120
119
|
"""
|
|
121
120
|
Forces this app bar to be transparent (instead of Material's default type).
|
|
122
121
|
|
|
123
|
-
This will also remove the visual display of [`bgcolor`][
|
|
124
|
-
and [`elevation`][
|
|
125
|
-
other characteristics of this app bar.
|
|
122
|
+
This will also remove the visual display of [`bgcolor`][(c).]
|
|
123
|
+
and [`elevation`][(c).], and affect other characteristics of this app bar.
|
|
126
124
|
"""
|
|
127
125
|
|
|
128
126
|
secondary: bool = False
|
|
@@ -132,42 +130,41 @@ class AppBar(AdaptiveControl):
|
|
|
132
130
|
|
|
133
131
|
title_spacing: Optional[Number] = None
|
|
134
132
|
"""
|
|
135
|
-
The spacing around [`title`][
|
|
133
|
+
The spacing around [`title`][(c).] on the horizontal axis.
|
|
136
134
|
It is applied even if there are
|
|
137
|
-
no [`leading`][
|
|
135
|
+
no [`leading`][(c).] or [`actions`][(c).] controls.
|
|
138
136
|
|
|
139
137
|
Tip:
|
|
140
|
-
If you want [`title`][
|
|
141
|
-
set
|
|
138
|
+
If you want [`title`][(c).] to take all the space available,
|
|
139
|
+
set `title_spacing` to `0.0`.
|
|
142
140
|
"""
|
|
143
141
|
|
|
144
142
|
exclude_header_semantics: bool = False
|
|
145
143
|
"""
|
|
146
|
-
Whether the [`title`][
|
|
147
|
-
[`Semantics`][flet.
|
|
144
|
+
Whether the [`title`][(c).] should be wrapped with header
|
|
145
|
+
[`Semantics`][flet.].
|
|
148
146
|
"""
|
|
149
147
|
|
|
150
148
|
actions: Optional[list[Control]] = None
|
|
151
149
|
"""
|
|
152
150
|
A list of `Control`s to display in a row after the title control.
|
|
153
151
|
|
|
154
|
-
Typically, these controls are [`IconButton`][flet.
|
|
152
|
+
Typically, these controls are [`IconButton`][flet.]s
|
|
155
153
|
representing common operations. For less common operations, consider using a
|
|
156
|
-
[`PopupMenuButton`][flet.
|
|
154
|
+
[`PopupMenuButton`][flet.] as the last
|
|
157
155
|
action.
|
|
158
156
|
|
|
159
157
|
Info:
|
|
160
|
-
If [`AppBar.adaptive
|
|
158
|
+
If [`AppBar.adaptive`][(c).adaptive] is `True` and this app is opened on an
|
|
161
159
|
iOS or macOS device, these `actions` will be automatically placed in a
|
|
162
|
-
[`Row`][flet.
|
|
163
|
-
This is because [`CupertinoAppBar.trailing`][flet.
|
|
160
|
+
[`Row`][flet.].
|
|
161
|
+
This is because [`CupertinoAppBar.trailing`][flet.]
|
|
164
162
|
(which is the counterpart property of `actions`) takes only a single `Control`.
|
|
165
163
|
"""
|
|
166
164
|
|
|
167
165
|
actions_padding: Optional[PaddingValue] = None
|
|
168
166
|
"""
|
|
169
|
-
The padding between the [`actions`][
|
|
170
|
-
and the end of this app bar.
|
|
167
|
+
The padding between the [`actions`][(c).] and the end of this app bar.
|
|
171
168
|
"""
|
|
172
169
|
|
|
173
170
|
toolbar_opacity: Number = 1.0
|
|
@@ -180,14 +177,13 @@ class AppBar(AdaptiveControl):
|
|
|
180
177
|
|
|
181
178
|
title_text_style: Optional[TextStyle] = None
|
|
182
179
|
"""
|
|
183
|
-
The style to be used for the [`Text`][flet.
|
|
184
|
-
[`title`][flet.AppBar.title].
|
|
180
|
+
The style to be used for the [`Text`][flet.] controls in the [`title`][(c).].
|
|
185
181
|
"""
|
|
186
182
|
|
|
187
183
|
toolbar_text_style: Optional[TextStyle] = None
|
|
188
184
|
"""
|
|
189
|
-
The style to be used for the [`Text`][flet.
|
|
190
|
-
app bar's [`leading`][
|
|
185
|
+
The style to be used for the [`Text`][flet.] controls in the
|
|
186
|
+
app bar's [`leading`][(c).] and [`actions`][(c).].
|
|
191
187
|
"""
|
|
192
188
|
|
|
193
189
|
shape: Optional[OutlinedBorder] = None
|
|
@@ -6,7 +6,7 @@ from flet.controls.control import Control
|
|
|
6
6
|
from flet.controls.control_event import Event, EventHandler
|
|
7
7
|
from flet.controls.types import Number
|
|
8
8
|
|
|
9
|
-
__all__ = ["AutoComplete", "
|
|
9
|
+
__all__ = ["AutoComplete", "AutoCompleteSelectEvent", "AutoCompleteSuggestion"]
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
@dataclass
|
|
@@ -29,16 +29,18 @@ class AutoComplete(Control):
|
|
|
29
29
|
|
|
30
30
|
suggestions: list[AutoCompleteSuggestion] = field(default_factory=list)
|
|
31
31
|
"""
|
|
32
|
-
A list of [`AutoCompleteSuggestion`][flet.
|
|
32
|
+
A list of [`AutoCompleteSuggestion`][flet.]
|
|
33
33
|
controls representing the suggestions to be displayed.
|
|
34
34
|
|
|
35
35
|
Note:
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
- A valid [`AutoCompleteSuggestion`][flet.] must have at least a
|
|
37
|
+
[`key`][flet.AutoCompleteSuggestion.] or
|
|
38
|
+
[`value`][flet.AutoCompleteSuggestion.] specified, else it will be
|
|
39
|
+
ignored. If only `key` is provided, `value` will be set to `key` as
|
|
40
|
+
fallback and vice versa.
|
|
41
|
+
- The internal filtration process of the suggestions (based on their `key`s)
|
|
42
|
+
with respect to the user's input is case-insensitive because the
|
|
43
|
+
comparison is done in lowercase.
|
|
42
44
|
"""
|
|
43
45
|
|
|
44
46
|
suggestions_max_height: Number = 200
|
flet/controls/material/badge.py
CHANGED
|
@@ -14,93 +14,97 @@ __all__ = ["Badge", "BadgeValue"]
|
|
|
14
14
|
class Badge(BaseControl):
|
|
15
15
|
"""
|
|
16
16
|
Badges are used to show notifications, counts, or status information on navigation
|
|
17
|
-
items such as [`NavigationBar`][flet.
|
|
18
|
-
|
|
17
|
+
items such as [`NavigationBar`][flet.] or [`NavigationRail`][flet.] destinations
|
|
18
|
+
or a button's icon.
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
label: Optional[StrOrControl] = None
|
|
22
22
|
"""
|
|
23
23
|
The label of this badge.
|
|
24
24
|
|
|
25
|
-
Typically a 1 to 4 characters text.
|
|
25
|
+
Typically a `1` to `4` characters text.
|
|
26
26
|
|
|
27
27
|
If the label is not provided, the badge is shown as a filled circle of
|
|
28
|
-
[`small_size`][
|
|
28
|
+
[`small_size`][(c).] diameter.
|
|
29
29
|
|
|
30
|
-
If `label` is provided,
|
|
31
|
-
to [`large_size`][
|
|
30
|
+
If `label` is provided, it is a [`StadiumBorder`][flet.] shaped
|
|
31
|
+
badge with height equal to [`large_size`][(c).].
|
|
32
32
|
"""
|
|
33
33
|
|
|
34
34
|
offset: Optional[OffsetValue] = None
|
|
35
35
|
"""
|
|
36
36
|
Combined with `alignment` to determine the location of the
|
|
37
|
-
[`label`][
|
|
37
|
+
[`label`][(c).] relative to the content.
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Note:
|
|
40
|
+
Has effect only used if [`label`][(c).] is also provided.
|
|
40
41
|
"""
|
|
41
42
|
|
|
42
43
|
alignment: Optional[Alignment] = None
|
|
43
44
|
"""
|
|
44
45
|
Aligns the [`label][flet.Badge.label] relative to the content of the badge.
|
|
45
46
|
|
|
46
|
-
The alignment positions the
|
|
47
|
-
positioned using [`Container.alignment`][flet.
|
|
48
|
-
except that the badge alignment is resolved as if the label was a
|
|
49
|
-
square and [`offset`][
|
|
47
|
+
The alignment positions the [`label`][(c).] in similar way
|
|
48
|
+
[`Container.content`][flet.] is positioned using [`Container.alignment`][flet.],
|
|
49
|
+
except that the badge alignment is resolved as if the `label` was a
|
|
50
|
+
[`large_size`][(c).] square and [`offset`][(c).] is added to the result.
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
Note:
|
|
53
|
+
Has effect only used if [`label`][(c).] is also provided.
|
|
52
54
|
"""
|
|
53
55
|
|
|
54
56
|
bgcolor: Optional[ColorValue] = None
|
|
55
57
|
"""
|
|
56
|
-
The background color of the [`label`][
|
|
58
|
+
The background color of the [`label`][(c).].
|
|
57
59
|
"""
|
|
58
60
|
|
|
59
61
|
label_visible: bool = True
|
|
60
62
|
"""
|
|
61
|
-
Whether the [`label`][
|
|
63
|
+
Whether the [`label`][(c).] should be visible.
|
|
62
64
|
|
|
63
65
|
It can be used to create a badge only shown under certain conditions.
|
|
64
66
|
"""
|
|
65
67
|
|
|
66
68
|
large_size: Optional[Number] = None
|
|
67
69
|
"""
|
|
68
|
-
The badge's label height if [`label`][
|
|
70
|
+
The badge's label height if [`label`][(c).] is provided.
|
|
69
71
|
|
|
70
|
-
If the default value is overridden then it may be useful to also override
|
|
71
|
-
and `alignment
|
|
72
|
+
If the default value is overridden then it may be useful to also override
|
|
73
|
+
[`padding`][(c).] and [`alignment`][(c).].
|
|
72
74
|
|
|
73
|
-
Defaults to [`BadgeTheme.large_size`][flet.
|
|
75
|
+
Defaults to [`BadgeTheme.large_size`][flet.], or if that is `None`,
|
|
74
76
|
falls back to `16`.
|
|
75
77
|
"""
|
|
76
78
|
|
|
77
79
|
padding: Optional[PaddingValue] = None
|
|
78
80
|
"""
|
|
79
|
-
The padding added to the [`label`][
|
|
81
|
+
The padding added to the [`label`][(c).].
|
|
80
82
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
Defaults to [`BadgeTheme.padding`][flet.BadgeTheme.padding], or if that is `None`,
|
|
83
|
+
Defaults to [`BadgeTheme.padding`][flet.], or if that is `None`,
|
|
84
84
|
falls back to `4` pixels on the left and right.
|
|
85
|
+
|
|
86
|
+
Note:
|
|
87
|
+
Has effect only if [`label`][(c).] is not `None`.
|
|
85
88
|
"""
|
|
86
89
|
|
|
87
90
|
small_size: Optional[Number] = None
|
|
88
91
|
"""
|
|
89
|
-
The badge's label diameter if [`label`][
|
|
92
|
+
The badge's label diameter if [`label`][(c).] is not provided.
|
|
90
93
|
|
|
91
|
-
Defaults to [`BadgeTheme.small_size`][flet.
|
|
94
|
+
Defaults to [`BadgeTheme.small_size`][flet.], or if that is `None`,
|
|
92
95
|
falls back to `6`.
|
|
93
96
|
"""
|
|
94
97
|
|
|
95
98
|
text_color: Optional[ColorValue] = None
|
|
96
99
|
"""
|
|
97
|
-
The color of the text shown in the label.
|
|
98
|
-
|
|
100
|
+
The color of the text shown in the [`label`][(c).].
|
|
101
|
+
|
|
102
|
+
It overrides the color of the [`label`][(c).]'s [`text_style`][(c).].
|
|
99
103
|
"""
|
|
100
104
|
|
|
101
105
|
text_style: Optional[TextStyle] = None
|
|
102
106
|
"""
|
|
103
|
-
The text style to use for text in the [`label`][
|
|
107
|
+
The text style to use for text in the [`label`][(c).].
|
|
104
108
|
"""
|
|
105
109
|
|
|
106
110
|
|
flet/controls/material/banner.py
CHANGED
|
@@ -38,14 +38,14 @@ class Banner(DialogControl):
|
|
|
38
38
|
"""
|
|
39
39
|
The content of this banner.
|
|
40
40
|
|
|
41
|
-
Typically a [`Text`][flet.
|
|
41
|
+
Typically a [`Text`][flet.] control.
|
|
42
42
|
"""
|
|
43
43
|
|
|
44
44
|
actions: list[Control]
|
|
45
45
|
"""
|
|
46
46
|
The set of actions that are displayed at the bottom or trailing side of this banner.
|
|
47
47
|
|
|
48
|
-
Typically this is a list of [`TextButton`][flet.
|
|
48
|
+
Typically this is a list of [`TextButton`][flet.]
|
|
49
49
|
controls.
|
|
50
50
|
"""
|
|
51
51
|
|
|
@@ -53,20 +53,20 @@ class Banner(DialogControl):
|
|
|
53
53
|
"""
|
|
54
54
|
The leading Control of this banner.
|
|
55
55
|
|
|
56
|
-
Typically an [`Icon`][flet.
|
|
56
|
+
Typically an [`Icon`][flet.] control.
|
|
57
57
|
"""
|
|
58
58
|
|
|
59
59
|
leading_padding: Optional[PaddingValue] = None
|
|
60
60
|
"""
|
|
61
|
-
The amount of space by which to inset the [`leading`][
|
|
61
|
+
The amount of space by which to inset the [`leading`][(c).] control.
|
|
62
62
|
|
|
63
|
-
Defaults to [`BannerTheme.leading_padding`][flet.
|
|
63
|
+
Defaults to [`BannerTheme.leading_padding`][flet.],
|
|
64
64
|
or if that is `None`, falls back to `Padding.only(end=16)`.
|
|
65
65
|
"""
|
|
66
66
|
|
|
67
67
|
content_padding: Optional[PaddingValue] = None
|
|
68
68
|
"""
|
|
69
|
-
The amount of space by which to inset the [`content`][
|
|
69
|
+
The amount of space by which to inset the [`content`][(c).].
|
|
70
70
|
|
|
71
71
|
If the actions are below the content, this defaults to
|
|
72
72
|
`Padding.only(left=16.0, top=24.0, right=16.0, bottom=4.0)`.
|
|
@@ -77,12 +77,13 @@ class Banner(DialogControl):
|
|
|
77
77
|
|
|
78
78
|
force_actions_below: bool = False
|
|
79
79
|
"""
|
|
80
|
-
An override to force the [`actions`][
|
|
81
|
-
[`content`][
|
|
80
|
+
An override to force the [`actions`][(c).] to be below the
|
|
81
|
+
[`content`][(c).] regardless of how many there are.
|
|
82
82
|
|
|
83
|
-
If this is `True`, the `actions` will be placed below the content.
|
|
84
|
-
`False`, the `actions` will be placed on the trailing side
|
|
85
|
-
`actions` length is `1` and below the `content`
|
|
83
|
+
If this is `True`, the [`actions`][(c).] will be placed below the content.
|
|
84
|
+
If this is `False`, the [`actions`][(c).] will be placed on the trailing side
|
|
85
|
+
of the [`content`][(c).] if `actions` length is `1` and below the `content`
|
|
86
|
+
if greater than `1`.
|
|
86
87
|
"""
|
|
87
88
|
|
|
88
89
|
bgcolor: Optional[ColorValue] = None
|
|
@@ -112,13 +113,12 @@ class Banner(DialogControl):
|
|
|
112
113
|
|
|
113
114
|
content_text_style: Optional[TextStyle] = None
|
|
114
115
|
"""
|
|
115
|
-
The style to be used for the [`Text`][flet.
|
|
116
|
-
[`content`][flet.Banner.content].
|
|
116
|
+
The style to be used for the [`Text`][flet.] controls in the [`content`][(c).].
|
|
117
117
|
"""
|
|
118
118
|
|
|
119
119
|
min_action_bar_height: Number = 52.0
|
|
120
120
|
"""
|
|
121
|
-
The
|
|
121
|
+
The minimum action bar height.
|
|
122
122
|
"""
|
|
123
123
|
|
|
124
124
|
on_visible: Optional[ControlEventHandler["Banner"]] = None
|
|
@@ -30,11 +30,10 @@ class BottomAppBar(LayoutControl):
|
|
|
30
30
|
|
|
31
31
|
bgcolor: Optional[ColorValue] = None
|
|
32
32
|
"""
|
|
33
|
-
The fill color to use for this
|
|
34
|
-
app bar.
|
|
33
|
+
The fill color to use for this app bar.
|
|
35
34
|
|
|
36
|
-
Defaults to [`BottomAppBarTheme.bgcolor`][flet.
|
|
37
|
-
that is `None`, falls back to [`ColorScheme.surface`][flet.
|
|
35
|
+
Defaults to [`BottomAppBarTheme.bgcolor`][flet.], or if
|
|
36
|
+
that is `None`, falls back to [`ColorScheme.surface`][flet.].
|
|
38
37
|
"""
|
|
39
38
|
|
|
40
39
|
shadow_color: Optional[ColorValue] = None
|
|
@@ -46,14 +45,13 @@ class BottomAppBar(LayoutControl):
|
|
|
46
45
|
"""
|
|
47
46
|
Empty space to inscribe inside a container decoration (background, border).
|
|
48
47
|
|
|
49
|
-
Defaults to [`BottomAppBarTheme.padding`][flet.
|
|
48
|
+
Defaults to [`BottomAppBarTheme.padding`][flet.], or if
|
|
50
49
|
that is `None`, falls back to `Padding.symmetric(vertical=12.0, horizontal=16.0)`.
|
|
51
50
|
"""
|
|
52
51
|
|
|
53
52
|
clip_behavior: ClipBehavior = ClipBehavior.NONE
|
|
54
53
|
"""
|
|
55
|
-
Defines how the [`content`][
|
|
56
|
-
clipped.
|
|
54
|
+
Defines how the [`content`][(c).] of this app bar should be clipped.
|
|
57
55
|
"""
|
|
58
56
|
|
|
59
57
|
shape: Optional[NotchShape] = None
|
|
@@ -63,10 +61,10 @@ class BottomAppBar(LayoutControl):
|
|
|
63
61
|
|
|
64
62
|
notch_margin: Number = 4.0
|
|
65
63
|
"""
|
|
66
|
-
The margin between the [`FloatingActionButton`][flet.
|
|
64
|
+
The margin between the [`FloatingActionButton`][flet.] and this
|
|
67
65
|
app bar's notch.
|
|
68
66
|
|
|
69
|
-
Can be visible only if `shape
|
|
67
|
+
Can be visible only if [`shape`][(c).] is `None`.
|
|
70
68
|
"""
|
|
71
69
|
|
|
72
70
|
elevation: Optional[Number] = None
|
|
@@ -30,22 +30,22 @@ class BottomSheet(DialogControl):
|
|
|
30
30
|
|
|
31
31
|
elevation: Optional[Number] = None
|
|
32
32
|
"""
|
|
33
|
-
Defines the size of the shadow below
|
|
33
|
+
Defines the size of the shadow below this bottom sheet.
|
|
34
34
|
"""
|
|
35
35
|
|
|
36
36
|
bgcolor: Optional[ColorValue] = None
|
|
37
37
|
"""
|
|
38
|
-
The
|
|
38
|
+
The background color of this bottom sheet.
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
41
|
dismissible: bool = True
|
|
42
42
|
"""
|
|
43
|
-
Specifies whether
|
|
43
|
+
Specifies whether this bottom sheet will be dismissed when user taps on the scrim.
|
|
44
44
|
"""
|
|
45
45
|
|
|
46
46
|
enable_drag: bool = False
|
|
47
47
|
"""
|
|
48
|
-
Specifies whether
|
|
48
|
+
Specifies whether this bottom sheet can be dragged up and down and dismissed by
|
|
49
49
|
swiping downwards.
|
|
50
50
|
"""
|
|
51
51
|
|
|
@@ -62,34 +62,34 @@ class BottomSheet(DialogControl):
|
|
|
62
62
|
|
|
63
63
|
scroll_controlled: bool = False
|
|
64
64
|
"""
|
|
65
|
-
Specifies if
|
|
65
|
+
Specifies if this bottom sheet contains scrollable content, such as ListView or
|
|
66
66
|
GridView.
|
|
67
67
|
"""
|
|
68
68
|
|
|
69
69
|
maintain_bottom_view_insets_padding: bool = True
|
|
70
70
|
"""
|
|
71
|
-
Adds a padding at the bottom to avoid obstructing bottom sheet content with
|
|
71
|
+
Adds a padding at the bottom to avoid obstructing the bottom sheet's content with
|
|
72
72
|
on-screen keyboard or other system elements.
|
|
73
73
|
"""
|
|
74
74
|
|
|
75
75
|
animation_style: Optional[AnimationStyle] = None
|
|
76
76
|
"""
|
|
77
|
-
The
|
|
77
|
+
The animation style of this bottom sheet.
|
|
78
78
|
"""
|
|
79
79
|
|
|
80
80
|
size_constraints: Optional[BoxConstraints] = None
|
|
81
81
|
"""
|
|
82
|
-
The size constraints to apply to
|
|
82
|
+
The size constraints to apply to this bottom sheet.
|
|
83
83
|
"""
|
|
84
84
|
|
|
85
85
|
clip_behavior: Optional[ClipBehavior] = None
|
|
86
86
|
"""
|
|
87
|
-
Defines how the content of
|
|
87
|
+
Defines how the content of this bottom sheet should be clipped.
|
|
88
88
|
"""
|
|
89
89
|
|
|
90
90
|
shape: Optional[OutlinedBorder] = None
|
|
91
91
|
"""
|
|
92
|
-
Defines the shape of
|
|
92
|
+
Defines the shape of this bottom sheet.
|
|
93
93
|
"""
|
|
94
94
|
|
|
95
95
|
barrier_color: Optional[ColorValue] = None
|
flet/controls/material/button.py
CHANGED
|
@@ -22,31 +22,9 @@ __all__ = ["Button"]
|
|
|
22
22
|
@control("Button")
|
|
23
23
|
class Button(LayoutControl, AdaptiveControl):
|
|
24
24
|
"""
|
|
25
|
-
A customizable button control that can display text, icons, or both.
|
|
26
|
-
various styles, colors, and event handlers for user interaction.
|
|
25
|
+
A customizable button control that can display text, icons, or both.
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
```python
|
|
30
|
-
import flet as ft
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def main(page: ft.Page):
|
|
34
|
-
def on_click(e):
|
|
35
|
-
print("Button clicked!")
|
|
36
|
-
|
|
37
|
-
page.add(
|
|
38
|
-
ft.Button(
|
|
39
|
-
content="Click Me",
|
|
40
|
-
icon=ft.Icons.ADD,
|
|
41
|
-
color="white",
|
|
42
|
-
bgcolor="blue",
|
|
43
|
-
on_click=on_click,
|
|
44
|
-
)
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
ft.run(main)
|
|
49
|
-
```
|
|
27
|
+
It supports various styles, colors, and event handlers for user interaction.
|
|
50
28
|
"""
|
|
51
29
|
|
|
52
30
|
content: Optional[StrOrControl] = None
|
flet/controls/material/card.py
CHANGED
|
@@ -29,8 +29,8 @@ class Card(LayoutControl, AdaptiveControl):
|
|
|
29
29
|
The Control to display inside the card.
|
|
30
30
|
|
|
31
31
|
Tip:
|
|
32
|
-
To display multiple children, wrap them in a control like [`Row`][flet.
|
|
33
|
-
[`Column`][flet.
|
|
32
|
+
To display multiple children, wrap them in a control like [`Row`][flet.],
|
|
33
|
+
[`Column`][flet.], or [`Stack`][flet.], which accept
|
|
34
34
|
a `controls` list.
|
|
35
35
|
"""
|
|
36
36
|
|
|
@@ -39,7 +39,7 @@ class Card(LayoutControl, AdaptiveControl):
|
|
|
39
39
|
The z-coordinate at which to place this card.
|
|
40
40
|
Defines the size of the shadow below the card.
|
|
41
41
|
|
|
42
|
-
Defaults to [`CardTheme.elevation`][flet.
|
|
42
|
+
Defaults to [`CardTheme.elevation`][flet.], or if that is `None`,
|
|
43
43
|
falls back to `1.0`.
|
|
44
44
|
"""
|
|
45
45
|
|
|
@@ -50,11 +50,10 @@ class Card(LayoutControl, AdaptiveControl):
|
|
|
50
50
|
|
|
51
51
|
shadow_color: Optional[ColorValue] = None
|
|
52
52
|
"""
|
|
53
|
-
The color to paint the shadow below this
|
|
54
|
-
card.
|
|
53
|
+
The color to paint the shadow below this card.
|
|
55
54
|
|
|
56
|
-
Defaults to [`CardTheme.shadow_color`][flet.
|
|
57
|
-
or if that is `None`, falls back to [`Theme.shadow_color`][flet.
|
|
55
|
+
Defaults to [`CardTheme.shadow_color`][flet.],
|
|
56
|
+
or if that is `None`, falls back to [`Theme.shadow_color`][flet.]
|
|
58
57
|
(which defaults to `Colors.BLACK`).
|
|
59
58
|
"""
|
|
60
59
|
|
|
@@ -62,15 +61,15 @@ class Card(LayoutControl, AdaptiveControl):
|
|
|
62
61
|
"""
|
|
63
62
|
The shape of this card.
|
|
64
63
|
|
|
65
|
-
Defaults to [`CardTheme.shape`][flet.
|
|
64
|
+
Defaults to [`CardTheme.shape`][flet.], or if that is `None`,
|
|
66
65
|
falls back to `RoundedRectangleBorder(radius=12.0)`.
|
|
67
66
|
"""
|
|
68
67
|
|
|
69
68
|
clip_behavior: Optional[ClipBehavior] = None
|
|
70
69
|
"""
|
|
71
|
-
Defines how the [`content`][
|
|
70
|
+
Defines how the [`content`][(c).] will be clipped.
|
|
72
71
|
|
|
73
|
-
Defaults to [`CardTheme.clip_behavior`][flet.
|
|
72
|
+
Defaults to [`CardTheme.clip_behavior`][flet.],
|
|
74
73
|
or if that is `None`, falls back to `ClipBehavior.NONE`.
|
|
75
74
|
"""
|
|
76
75
|
|
|
@@ -84,7 +83,7 @@ class Card(LayoutControl, AdaptiveControl):
|
|
|
84
83
|
show_border_on_foreground: bool = True
|
|
85
84
|
"""
|
|
86
85
|
Whether the shape of the border should be painted in front of the
|
|
87
|
-
[`content`][
|
|
86
|
+
[`content`][(c).] or behind.
|
|
88
87
|
"""
|
|
89
88
|
|
|
90
89
|
variant: CardVariant = CardVariant.ELEVATED
|