flet 0.70.0.dev6214__py3-none-any.whl → 0.70.0.dev6268__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/controls/base_control.py +1 -1
- flet/controls/border.py +3 -3
- flet/controls/control.py +6 -4
- flet/controls/core/animated_switcher.py +3 -3
- flet/controls/core/autofill_group.py +5 -3
- flet/controls/core/column.py +15 -2
- flet/controls/core/dismissible.py +9 -5
- flet/controls/core/drag_target.py +5 -3
- flet/controls/core/draggable.py +6 -4
- flet/controls/core/grid_view.py +22 -0
- flet/controls/core/icon.py +12 -4
- flet/controls/core/image.py +9 -0
- flet/controls/core/interactive_viewer.py +16 -8
- flet/controls/core/pagelet.py +3 -3
- flet/controls/core/reorderable_draggable.py +5 -3
- flet/controls/core/safe_area.py +5 -3
- flet/controls/core/text.py +4 -0
- flet/controls/core/text_span.py +3 -3
- flet/controls/core/window_drag_area.py +3 -3
- flet/controls/cupertino/cupertino_action_sheet.py +4 -4
- flet/controls/cupertino/cupertino_action_sheet_action.py +3 -3
- flet/controls/cupertino/cupertino_activity_indicator.py +3 -3
- flet/controls/cupertino/cupertino_button.py +7 -3
- flet/controls/cupertino/cupertino_checkbox.py +11 -0
- flet/controls/cupertino/cupertino_context_menu.py +6 -4
- flet/controls/cupertino/cupertino_context_menu_action.py +3 -3
- flet/controls/cupertino/cupertino_date_picker.py +26 -9
- flet/controls/cupertino/cupertino_dialog_action.py +3 -3
- flet/controls/cupertino/cupertino_filled_button.py +4 -0
- flet/controls/cupertino/cupertino_list_tile.py +14 -3
- flet/controls/cupertino/cupertino_navigation_bar.py +8 -5
- flet/controls/cupertino/cupertino_picker.py +9 -4
- flet/controls/cupertino/cupertino_radio.py +14 -0
- flet/controls/cupertino/cupertino_segmented_button.py +18 -4
- flet/controls/cupertino/cupertino_slider.py +13 -4
- flet/controls/cupertino/cupertino_sliding_segmented_button.py +18 -4
- flet/controls/cupertino/cupertino_switch.py +4 -0
- flet/controls/cupertino/cupertino_textfield.py +4 -0
- flet/controls/cupertino/cupertino_timer_picker.py +16 -13
- flet/controls/cupertino/cupertino_tinted_button.py +4 -0
- flet/controls/material/alert_dialog.py +4 -4
- flet/controls/material/app_bar.py +10 -6
- flet/controls/material/banner.py +10 -6
- flet/controls/material/bottom_app_bar.py +3 -3
- flet/controls/material/bottom_sheet.py +3 -3
- flet/controls/material/card.py +15 -0
- flet/controls/material/checkbox.py +6 -0
- flet/controls/material/chip.py +16 -5
- flet/controls/material/circle_avatar.py +19 -5
- flet/controls/material/datatable.py +56 -19
- flet/controls/material/divider.py +23 -5
- flet/controls/material/dropdown.py +14 -3
- flet/controls/material/dropdownm2.py +11 -0
- flet/controls/material/expansion_panel.py +34 -0
- flet/controls/material/expansion_tile.py +15 -2
- flet/controls/material/filled_button.py +4 -0
- flet/controls/material/filled_tonal_button.py +4 -0
- flet/controls/material/floating_action_button.py +22 -7
- flet/controls/material/icon_button.py +14 -2
- flet/controls/material/list_tile.py +11 -0
- flet/controls/material/navigation_rail.py +9 -5
- flet/controls/material/outlined_button.py +3 -3
- flet/controls/material/progress_bar.py +9 -5
- flet/controls/material/radio_group.py +3 -3
- flet/controls/material/range_slider.py +15 -6
- flet/controls/material/segmented_button.py +20 -11
- flet/controls/material/selection_area.py +3 -3
- flet/controls/material/slider.py +10 -5
- flet/controls/material/snack_bar.py +9 -5
- flet/controls/material/switch.py +3 -3
- flet/controls/material/tabs.py +18 -14
- flet/controls/material/textfield.py +14 -5
- flet/controls/material/vertical_divider.py +12 -6
- flet/testing/flet_test_app.py +1 -0
- flet/version.py +1 -1
- {flet-0.70.0.dev6214.dist-info → flet-0.70.0.dev6268.dist-info}/METADATA +1 -1
- {flet-0.70.0.dev6214.dist-info → flet-0.70.0.dev6268.dist-info}/RECORD +80 -80
- {flet-0.70.0.dev6214.dist-info → flet-0.70.0.dev6268.dist-info}/WHEEL +0 -0
- {flet-0.70.0.dev6214.dist-info → flet-0.70.0.dev6268.dist-info}/entry_points.txt +0 -0
- {flet-0.70.0.dev6214.dist-info → flet-0.70.0.dev6268.dist-info}/top_level.txt +0 -0
flet/controls/base_control.py
CHANGED
|
@@ -60,7 +60,7 @@ def control(
|
|
|
60
60
|
isolated: If `True`, marks the control as isolated. An isolated control
|
|
61
61
|
is excluded from page updates when its parent control is updated.
|
|
62
62
|
post_init_args: Number of InitVar arguments to pass to __post_init__.
|
|
63
|
-
|
|
63
|
+
dataclass_kwargs: Additional keyword arguments passed to `@dataclass`.
|
|
64
64
|
|
|
65
65
|
Usage:
|
|
66
66
|
- Supports `@control` (without parentheses)
|
flet/controls/border.py
CHANGED
|
@@ -51,9 +51,6 @@ class BorderSide:
|
|
|
51
51
|
Creates the side of a border.
|
|
52
52
|
|
|
53
53
|
By default, the border is `1.0` logical pixels wide and solid black color.
|
|
54
|
-
|
|
55
|
-
Raises:
|
|
56
|
-
AssertionError: if [`width`][(c).] is negative.
|
|
57
54
|
"""
|
|
58
55
|
|
|
59
56
|
width: Number = 1.0
|
|
@@ -69,6 +66,9 @@ class BorderSide:
|
|
|
69
66
|
Tip:
|
|
70
67
|
To omit the border entirely, set the [`style`][(c).]
|
|
71
68
|
to [`BorderStyle.NONE`][flet.].
|
|
69
|
+
|
|
70
|
+
Raises:
|
|
71
|
+
AssertionError: If [`width`][(c).] is negative.
|
|
72
72
|
"""
|
|
73
73
|
|
|
74
74
|
color: ColorValue = Colors.BLACK
|
flet/controls/control.py
CHANGED
|
@@ -15,10 +15,6 @@ class Control(BaseControl):
|
|
|
15
15
|
Base class for controls.
|
|
16
16
|
|
|
17
17
|
Not meant to be used directly.
|
|
18
|
-
|
|
19
|
-
Raises:
|
|
20
|
-
ValueError: If [`opacity`][(c).] is not between `0.0` and `1.0` inclusive.
|
|
21
|
-
ValueError: If [`expand`][(c).] is not None and not of type `bool` or `int`.
|
|
22
18
|
"""
|
|
23
19
|
|
|
24
20
|
expand: Optional[Union[bool, int]] = None
|
|
@@ -33,6 +29,9 @@ class Control(BaseControl):
|
|
|
33
29
|
Has effect only if the direct parent of this control is one of the following
|
|
34
30
|
controls, or their subclasses: [`Column`][flet.], [`Row`][flet.],
|
|
35
31
|
[`View`][flet.], [`Page`][flet.].
|
|
32
|
+
|
|
33
|
+
Raises:
|
|
34
|
+
ValueError: If [`expand`][(c).] is not `None` and not of type `bool` or `int`.
|
|
36
35
|
"""
|
|
37
36
|
|
|
38
37
|
expand_loose: bool = False
|
|
@@ -83,6 +82,9 @@ class Control(BaseControl):
|
|
|
83
82
|
|
|
84
83
|
Value ranges from `0.0` (completely transparent) to `1.0` (completely opaque
|
|
85
84
|
without any transparency).
|
|
85
|
+
|
|
86
|
+
Raises:
|
|
87
|
+
ValueError: If [`opacity`][(c).] is not between `0.0` and `1.0` inclusive.
|
|
86
88
|
"""
|
|
87
89
|
|
|
88
90
|
tooltip: Optional[TooltipValue] = None
|
|
@@ -20,9 +20,6 @@ class AnimatedSwitcherTransition(Enum):
|
|
|
20
20
|
class AnimatedSwitcher(LayoutControl):
|
|
21
21
|
"""
|
|
22
22
|
Used to switch between controls with an animation.
|
|
23
|
-
|
|
24
|
-
Raises:
|
|
25
|
-
ValueError: If [`content`][(c).] is not visible.
|
|
26
23
|
"""
|
|
27
24
|
|
|
28
25
|
content: Control
|
|
@@ -31,6 +28,9 @@ class AnimatedSwitcher(LayoutControl):
|
|
|
31
28
|
|
|
32
29
|
When it changes, this switcher will animate the transition from the old/previous
|
|
33
30
|
`content` to the new one.
|
|
31
|
+
|
|
32
|
+
Raises:
|
|
33
|
+
ValueError: If [`content`][(c).] is not visible.
|
|
34
34
|
"""
|
|
35
35
|
|
|
36
36
|
duration: DurationValue = field(default_factory=lambda: Duration(seconds=1))
|
|
@@ -84,14 +84,16 @@ class AutofillGroupDisposeAction(Enum):
|
|
|
84
84
|
class AutofillGroup(Control):
|
|
85
85
|
"""
|
|
86
86
|
Used to group autofill controls together.
|
|
87
|
-
|
|
88
|
-
Raises:
|
|
89
|
-
ValueError: If [`content`][(c).] is not visible.
|
|
90
87
|
"""
|
|
91
88
|
|
|
92
89
|
content: Control
|
|
93
90
|
"""
|
|
94
91
|
The content of this group.
|
|
92
|
+
|
|
93
|
+
Must be visible.
|
|
94
|
+
|
|
95
|
+
Raises:
|
|
96
|
+
ValueError: If [`content`][(c).] is not visible.
|
|
95
97
|
"""
|
|
96
98
|
|
|
97
99
|
dispose_action: AutofillGroupDisposeAction = AutofillGroupDisposeAction.COMMIT
|
flet/controls/core/column.py
CHANGED
|
@@ -13,8 +13,21 @@ __all__ = ["Column"]
|
|
|
13
13
|
@control("Column")
|
|
14
14
|
class Column(LayoutControl, ScrollableControl, AdaptiveControl):
|
|
15
15
|
"""
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
Arranges child controls vertically, optionally aligning and spacing them within
|
|
17
|
+
the available space.
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
ft.Column(
|
|
21
|
+
width=220,
|
|
22
|
+
height=120,
|
|
23
|
+
spacing=12,
|
|
24
|
+
controls=[
|
|
25
|
+
ft.Text("Daily planning", size=20, weight=ft.FontWeight.W_600),
|
|
26
|
+
ft.Text("Review pull requests"),
|
|
27
|
+
ft.Text("Ship release"),
|
|
28
|
+
],
|
|
29
|
+
)
|
|
30
|
+
```
|
|
18
31
|
"""
|
|
19
32
|
|
|
20
33
|
controls: list[Control] = field(default_factory=list)
|
|
@@ -44,16 +44,16 @@ class Dismissible(LayoutControl, AdaptiveControl):
|
|
|
44
44
|
this control further animates its height (or width, depending on what is
|
|
45
45
|
perpendicular to the [`dismiss_direction`][(c).]), gradually reducing it to zero
|
|
46
46
|
over the specified [`resize_duration`][(c).].
|
|
47
|
-
|
|
48
|
-
Raises:
|
|
49
|
-
ValueError: If the [`content`][(c).] is not visible.
|
|
50
|
-
ValueError: If the [`secondary_background`][(c).] is provided and visible
|
|
51
|
-
but the [`background`][(c).] is not provided and visible.
|
|
52
47
|
"""
|
|
53
48
|
|
|
54
49
|
content: Control
|
|
55
50
|
"""
|
|
56
51
|
The control that is being dismissed.
|
|
52
|
+
|
|
53
|
+
Must be visible.
|
|
54
|
+
|
|
55
|
+
Raises:
|
|
56
|
+
ValueError: If the [`content`][(c).] is not visible.
|
|
57
57
|
"""
|
|
58
58
|
|
|
59
59
|
background: Optional[Control] = None
|
|
@@ -73,6 +73,10 @@ class Dismissible(LayoutControl, AdaptiveControl):
|
|
|
73
73
|
Note:
|
|
74
74
|
Can only be specified if [`background`][(c).] is also
|
|
75
75
|
specified/visible.
|
|
76
|
+
|
|
77
|
+
Raises:
|
|
78
|
+
ValueError: If the [`secondary_background`][(c).] is provided and visible
|
|
79
|
+
but the [`background`][(c).] is not provided and visible.
|
|
76
80
|
"""
|
|
77
81
|
|
|
78
82
|
dismiss_direction: DismissDirection = DismissDirection.HORIZONTAL
|
|
@@ -57,14 +57,16 @@ class DragTarget(Control):
|
|
|
57
57
|
does drop the `Draggable` on top of the `DragTarget` (and the `DragTarget` has
|
|
58
58
|
indicated that it will accept the `Draggable`'s data), then the `DragTarget` is
|
|
59
59
|
asked to accept the `Draggable`'s data.
|
|
60
|
-
|
|
61
|
-
Raises:
|
|
62
|
-
ValueError: If [`content`][(c).] is not visible.
|
|
63
60
|
"""
|
|
64
61
|
|
|
65
62
|
content: Control
|
|
66
63
|
"""
|
|
67
64
|
The content of this control.
|
|
65
|
+
|
|
66
|
+
Must be visible.
|
|
67
|
+
|
|
68
|
+
Raises:
|
|
69
|
+
ValueError: If [`content`][(c).] is not visible.
|
|
68
70
|
"""
|
|
69
71
|
|
|
70
72
|
group: str = "default"
|
flet/controls/core/draggable.py
CHANGED
|
@@ -17,10 +17,6 @@ class Draggable(Control):
|
|
|
17
17
|
[`content_feedback`][(c).] control that tracks the user's finger across the screen.
|
|
18
18
|
If the user lifts their finger while on top of a `DragTarget`, this target is
|
|
19
19
|
given the opportunity to complete drag-and-drop flow.
|
|
20
|
-
|
|
21
|
-
Raises:
|
|
22
|
-
ValueError: If [`content`][(c).] is not visible.
|
|
23
|
-
ValueError: If [`max_simultaneous_drags`][(c).] is set to a negative value.
|
|
24
20
|
"""
|
|
25
21
|
|
|
26
22
|
content: Control
|
|
@@ -29,6 +25,9 @@ class Draggable(Control):
|
|
|
29
25
|
|
|
30
26
|
If the draggable is being dragged, the
|
|
31
27
|
[`content_when_dragging`][(c).] is displayed instead.
|
|
28
|
+
|
|
29
|
+
Raises:
|
|
30
|
+
ValueError: If [`content`][(c).] is not visible.
|
|
32
31
|
"""
|
|
33
32
|
|
|
34
33
|
group: str = "default"
|
|
@@ -87,6 +86,9 @@ class Draggable(Control):
|
|
|
87
86
|
to visually indicate the item is being moved.
|
|
88
87
|
- Set to any positive integer to allow that many concurrent drags.
|
|
89
88
|
- If `None`, there is no limit on the number of simultaneous drags.
|
|
89
|
+
|
|
90
|
+
Raises:
|
|
91
|
+
ValueError: If [`max_simultaneous_drags`][(c).] is set to a negative value.
|
|
90
92
|
"""
|
|
91
93
|
|
|
92
94
|
on_drag_start: Optional[ControlEventHandler["Draggable"]] = None
|
flet/controls/core/grid_view.py
CHANGED
|
@@ -20,6 +20,28 @@ class GridView(LayoutControl, ScrollableControl, AdaptiveControl):
|
|
|
20
20
|
It is very effective for large lists (thousands of items).
|
|
21
21
|
Prefer it over wrapping [`Column`][flet.]s or
|
|
22
22
|
[`Row`][flet.]s for smooth scrolling.
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
ft.GridView(
|
|
26
|
+
width=180,
|
|
27
|
+
runs_count=2,
|
|
28
|
+
spacing=8,
|
|
29
|
+
controls=[
|
|
30
|
+
ft.Container(
|
|
31
|
+
width=50, height=50, bgcolor=ft.Colors.PRIMARY, border_radius=8
|
|
32
|
+
),
|
|
33
|
+
ft.Container(
|
|
34
|
+
width=50, height=50, bgcolor=ft.Colors.SECONDARY, border_radius=8
|
|
35
|
+
),
|
|
36
|
+
ft.Container(
|
|
37
|
+
width=50, height=50, bgcolor=ft.Colors.TERTIARY, border_radius=8
|
|
38
|
+
),
|
|
39
|
+
ft.Container(
|
|
40
|
+
width=50, height=50, bgcolor=ft.Colors.ERROR, border_radius=8
|
|
41
|
+
),
|
|
42
|
+
],
|
|
43
|
+
)
|
|
44
|
+
```
|
|
23
45
|
"""
|
|
24
46
|
|
|
25
47
|
controls: list[Control] = field(default_factory=list)
|
flet/controls/core/icon.py
CHANGED
|
@@ -16,10 +16,9 @@ class Icon(LayoutControl):
|
|
|
16
16
|
Icons can be customized in color, size, and visual style using various
|
|
17
17
|
parameters such as stroke weight, fill level, and shadows.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
ValueError: If [`optical_size`][(c).] is less than or equal to `0.0`.
|
|
19
|
+
```python
|
|
20
|
+
ft.Icon(ft.Icons.FAVORITE, color=ft.Colors.PRIMARY, size=40)
|
|
21
|
+
```
|
|
23
22
|
"""
|
|
24
23
|
|
|
25
24
|
icon: IconData
|
|
@@ -65,6 +64,9 @@ class Icon(LayoutControl):
|
|
|
65
64
|
|
|
66
65
|
This feature requires the icon's font to support fill variation.
|
|
67
66
|
It can be used to indicate state transitions or selection visually.
|
|
67
|
+
|
|
68
|
+
Raises:
|
|
69
|
+
ValueError: If [`fill`][(c).] is less than `0.0` or greater than `1.0`.
|
|
68
70
|
"""
|
|
69
71
|
|
|
70
72
|
apply_text_scaling: Optional[bool] = None
|
|
@@ -90,6 +92,9 @@ class Icon(LayoutControl):
|
|
|
90
92
|
|
|
91
93
|
This requires the icon font to support weight variation.
|
|
92
94
|
Must be greater than `0`.
|
|
95
|
+
|
|
96
|
+
Raises:
|
|
97
|
+
ValueError: If [`weight`][(c).] is less than or equal to `0.0`.
|
|
93
98
|
"""
|
|
94
99
|
|
|
95
100
|
optical_size: Optional[Number] = None
|
|
@@ -98,6 +103,9 @@ class Icon(LayoutControl):
|
|
|
98
103
|
|
|
99
104
|
This requires the icon font to support optical sizing.
|
|
100
105
|
Must be greater than `0`.
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
ValueError: If [`optical_size`][(c).] is less than or equal to `0.0`.
|
|
101
109
|
"""
|
|
102
110
|
|
|
103
111
|
blend_mode: Optional[BlendMode] = BlendMode.SRC_OVER
|
flet/controls/core/image.py
CHANGED
|
@@ -26,6 +26,15 @@ class Image(LayoutControl):
|
|
|
26
26
|
- [`src_bytes`][(c).]
|
|
27
27
|
- [`src_base64`][(c).]
|
|
28
28
|
- [`src`][(c).]
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
ft.Image(
|
|
32
|
+
src="https://picsum.photos/seed/picsum/100/100",
|
|
33
|
+
width=100,
|
|
34
|
+
height=100,
|
|
35
|
+
fit=ft.BoxFit.CONTAIN,
|
|
36
|
+
)
|
|
37
|
+
```
|
|
29
38
|
"""
|
|
30
39
|
|
|
31
40
|
src: Optional[str] = None
|
|
@@ -21,19 +21,16 @@ __all__ = ["InteractiveViewer"]
|
|
|
21
21
|
class InteractiveViewer(LayoutControl):
|
|
22
22
|
"""
|
|
23
23
|
Allows you to pan, zoom, and rotate its [`content`][(c).].
|
|
24
|
-
|
|
25
|
-
Raises:
|
|
26
|
-
ValueError: If [`content`][(c).] is not visible.
|
|
27
|
-
ValueError: If [`min_scale`][(c).] is not greater than `0`.
|
|
28
|
-
ValueError: If [`max_scale`][(c).] is not greater than `0`.
|
|
29
|
-
ValueError: If [`max_scale`][(c).] is less than `min_scale`.
|
|
30
|
-
ValueError: If [`interaction_end_friction_coefficient`][(c).] is not
|
|
31
|
-
greater than `0`.
|
|
32
24
|
"""
|
|
33
25
|
|
|
34
26
|
content: Control
|
|
35
27
|
"""
|
|
36
28
|
The `Control` to be transformed.
|
|
29
|
+
|
|
30
|
+
Must be visible.
|
|
31
|
+
|
|
32
|
+
Raises:
|
|
33
|
+
ValueError: If [`content`][(c).] is not visible.
|
|
37
34
|
"""
|
|
38
35
|
|
|
39
36
|
pan_enabled: bool = True
|
|
@@ -63,6 +60,10 @@ class InteractiveViewer(LayoutControl):
|
|
|
63
60
|
|
|
64
61
|
Note:
|
|
65
62
|
Must be greater than or equal to [`min_scale`][(c).].
|
|
63
|
+
|
|
64
|
+
Raises:
|
|
65
|
+
ValueError: If [`max_scale`][(c).] is not greater than `0` or is less than
|
|
66
|
+
[`min_scale`][(c).].
|
|
66
67
|
""" # noqa: E501
|
|
67
68
|
|
|
68
69
|
min_scale: Number = 0.8
|
|
@@ -72,6 +73,9 @@ class InteractiveViewer(LayoutControl):
|
|
|
72
73
|
Note:
|
|
73
74
|
Must be greater than `0` and less than or equal
|
|
74
75
|
to [`max_scale`][(c).].
|
|
76
|
+
|
|
77
|
+
Raises:
|
|
78
|
+
ValueError: If [`min_scale`][(c).] is not greater than `0`.
|
|
75
79
|
"""
|
|
76
80
|
|
|
77
81
|
interaction_end_friction_coefficient: Number = 0.0000135
|
|
@@ -80,6 +84,10 @@ class InteractiveViewer(LayoutControl):
|
|
|
80
84
|
|
|
81
85
|
Note:
|
|
82
86
|
Must be greater than `0`.
|
|
87
|
+
|
|
88
|
+
Raises:
|
|
89
|
+
ValueError: If [`interaction_end_friction_coefficient`][(c).] is not greater
|
|
90
|
+
than `0`.
|
|
83
91
|
"""
|
|
84
92
|
|
|
85
93
|
scale_factor: Number = 200
|
flet/controls/core/pagelet.py
CHANGED
|
@@ -24,9 +24,6 @@ class Pagelet(LayoutControl, AdaptiveControl):
|
|
|
24
24
|
Use it for projects that require a "page within a page" layouts with its own
|
|
25
25
|
[`AppBar`][flet.], [`BottomAppBar`][flet.], [`NavigationDrawer`][flet.],
|
|
26
26
|
such as demos and galleries.
|
|
27
|
-
|
|
28
|
-
Raises:
|
|
29
|
-
ValueError: If [`content`][(c).] is not visible.
|
|
30
27
|
"""
|
|
31
28
|
|
|
32
29
|
content: Control
|
|
@@ -35,6 +32,9 @@ class Pagelet(LayoutControl, AdaptiveControl):
|
|
|
35
32
|
|
|
36
33
|
The control in the content of the Pagelet is positioned at the top-left of the
|
|
37
34
|
available space between the app bar and the bottom of the Pagelet.
|
|
35
|
+
|
|
36
|
+
Raises:
|
|
37
|
+
ValueError: If [`content`][(c).] is not visible.
|
|
38
38
|
"""
|
|
39
39
|
|
|
40
40
|
appbar: Optional[Union[AppBar, CupertinoAppBar]] = None
|
|
@@ -11,9 +11,6 @@ class ReorderableDraggable(LayoutControl, AdaptiveControl):
|
|
|
11
11
|
|
|
12
12
|
It creates a listener for a drag immediately following a pointer down
|
|
13
13
|
event over the given [`content`][(c).] control.
|
|
14
|
-
|
|
15
|
-
Raises:
|
|
16
|
-
ValueError: If [`content`][(c).] is not visible.
|
|
17
14
|
"""
|
|
18
15
|
|
|
19
16
|
index: int
|
|
@@ -25,6 +22,11 @@ class ReorderableDraggable(LayoutControl, AdaptiveControl):
|
|
|
25
22
|
"""
|
|
26
23
|
The control for which the application would like to respond to a tap and
|
|
27
24
|
drag gesture by starting a reordering drag on a reorderable list.
|
|
25
|
+
|
|
26
|
+
Must be visible.
|
|
27
|
+
|
|
28
|
+
Raises:
|
|
29
|
+
ValueError: If [`content`][(c).] is not visible.
|
|
28
30
|
"""
|
|
29
31
|
|
|
30
32
|
def before_update(self):
|
flet/controls/core/safe_area.py
CHANGED
|
@@ -21,14 +21,16 @@ class SafeArea(LayoutControl, AdaptiveControl):
|
|
|
21
21
|
|
|
22
22
|
When a [`minimum_padding`][(c).] is specified, the greater of the minimum padding
|
|
23
23
|
or the safe area padding will be applied.
|
|
24
|
-
|
|
25
|
-
Raises:
|
|
26
|
-
ValueError: If [`content`][(c).] is not visible.
|
|
27
24
|
"""
|
|
28
25
|
|
|
29
26
|
content: Control
|
|
30
27
|
"""
|
|
31
28
|
The control to display.
|
|
29
|
+
|
|
30
|
+
Must be visible.
|
|
31
|
+
|
|
32
|
+
Raises:
|
|
33
|
+
ValueError: If [`content`][(c).] is not visible.
|
|
32
34
|
"""
|
|
33
35
|
|
|
34
36
|
avoid_intrusions_left: bool = True
|
flet/controls/core/text.py
CHANGED
|
@@ -178,6 +178,10 @@ class Text(LayoutControl):
|
|
|
178
178
|
|
|
179
179
|
It consists of two sources combined to produce the final text:
|
|
180
180
|
[`value`][(c).] and [`spans`][(c).].
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
ft.Text("Hello from Flet!", size=24, weight=ft.FontWeight.W_600)
|
|
184
|
+
```
|
|
181
185
|
"""
|
|
182
186
|
|
|
183
187
|
value: str = ""
|
flet/controls/core/text_span.py
CHANGED
|
@@ -18,9 +18,6 @@ class TextSpan(Control):
|
|
|
18
18
|
|
|
19
19
|
For the object to be useful, at least one of [`text`][(c).] or
|
|
20
20
|
[`spans`][(c).] should be set.
|
|
21
|
-
|
|
22
|
-
Raises:
|
|
23
|
-
ValueError: If [`semantics_label`][(c).] is set when [`text`][(c).] is `None`.
|
|
24
21
|
"""
|
|
25
22
|
|
|
26
23
|
text: Optional[str] = None
|
|
@@ -60,6 +57,9 @@ class TextSpan(Control):
|
|
|
60
57
|
|
|
61
58
|
If present, the semantics of this control will contain this value instead of the
|
|
62
59
|
actual text.
|
|
60
|
+
|
|
61
|
+
Raises:
|
|
62
|
+
ValueError: If [`semantics_label`][(c).] is set when [`text`][(c).] is `None`.
|
|
63
63
|
"""
|
|
64
64
|
|
|
65
65
|
spell_out: Optional[bool] = None
|
|
@@ -13,9 +13,6 @@ class WindowDragArea(LayoutControl):
|
|
|
13
13
|
"""
|
|
14
14
|
It mimics the behavior (drag, move, maximize, restore) of a native OS window
|
|
15
15
|
title bar on the [`content`][(c).] control.
|
|
16
|
-
|
|
17
|
-
Raises:
|
|
18
|
-
ValueError: If [`content`][(c).] is not visible.
|
|
19
16
|
"""
|
|
20
17
|
|
|
21
18
|
content: Control
|
|
@@ -23,6 +20,9 @@ class WindowDragArea(LayoutControl):
|
|
|
23
20
|
The content of this drag area.
|
|
24
21
|
|
|
25
22
|
Must be visible.
|
|
23
|
+
|
|
24
|
+
Raises:
|
|
25
|
+
ValueError: If [`content`][(c).] is not visible.
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
28
|
maximizable: bool = True
|
|
@@ -15,10 +15,6 @@ class CupertinoActionSheet(LayoutControl):
|
|
|
15
15
|
|
|
16
16
|
Action sheets are generally used to give the user a choice between
|
|
17
17
|
two or more choices for the current context.
|
|
18
|
-
|
|
19
|
-
Raises:
|
|
20
|
-
ValueError: If none of [`actions`][(c).], [`title`][(c).], [`message`][(c).],
|
|
21
|
-
or [`cancel`][(c).] are provided.
|
|
22
18
|
"""
|
|
23
19
|
|
|
24
20
|
title: Optional[StrOrControl] = None
|
|
@@ -41,6 +37,10 @@ class CupertinoActionSheet(LayoutControl):
|
|
|
41
37
|
A list of action buttons to be shown in the sheet.
|
|
42
38
|
|
|
43
39
|
These actions are typically [`CupertinoActionSheetAction`][flet.]s.
|
|
40
|
+
|
|
41
|
+
Raises:
|
|
42
|
+
ValueError: If none of [`actions`][(c).], [`title`][(c).], [`message`][(c).],
|
|
43
|
+
or [`cancel`][(c).] are provided.
|
|
44
44
|
"""
|
|
45
45
|
|
|
46
46
|
cancel: Optional[Control] = None
|
|
@@ -12,14 +12,14 @@ __all__ = ["CupertinoActionSheetAction"]
|
|
|
12
12
|
class CupertinoActionSheetAction(LayoutControl):
|
|
13
13
|
"""
|
|
14
14
|
An action button typically used in a CupertinoActionSheet.
|
|
15
|
-
|
|
16
|
-
Raises:
|
|
17
|
-
ValueError: If [`content`][(c).] is neither a string nor a visible Control.
|
|
18
15
|
"""
|
|
19
16
|
|
|
20
17
|
content: StrOrControl
|
|
21
18
|
"""
|
|
22
19
|
The child control to be shown in this action button.
|
|
20
|
+
|
|
21
|
+
Raises:
|
|
22
|
+
ValueError: If [`content`][(c).] is neither a string nor a visible Control.
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
25
|
default: bool = False
|
|
@@ -11,9 +11,6 @@ __all__ = ["CupertinoActivityIndicator"]
|
|
|
11
11
|
class CupertinoActivityIndicator(LayoutControl):
|
|
12
12
|
"""
|
|
13
13
|
An iOS-style activity indicator that spins clockwise.
|
|
14
|
-
|
|
15
|
-
Raises:
|
|
16
|
-
ValueError: If [`radius`][(c).] is not strictly greater than `0`.
|
|
17
14
|
"""
|
|
18
15
|
|
|
19
16
|
radius: Number = 10
|
|
@@ -22,6 +19,9 @@ class CupertinoActivityIndicator(LayoutControl):
|
|
|
22
19
|
|
|
23
20
|
Note:
|
|
24
21
|
Must be strictly greater than `0`.
|
|
22
|
+
|
|
23
|
+
Raises:
|
|
24
|
+
ValueError: If [`radius`][(c).] is not strictly greater than `0`.
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
color: Optional[ColorValue] = None
|
|
@@ -32,9 +32,9 @@ class CupertinoButton(LayoutControl):
|
|
|
32
32
|
"""
|
|
33
33
|
An iOS-style button.
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
```python
|
|
36
|
+
ft.CupertinoButton("Tap me")
|
|
37
|
+
```
|
|
38
38
|
"""
|
|
39
39
|
|
|
40
40
|
content: Optional[StrOrControl] = None
|
|
@@ -72,6 +72,10 @@ class CupertinoButton(LayoutControl):
|
|
|
72
72
|
Defines the opacity of the button when it is clicked.
|
|
73
73
|
|
|
74
74
|
When not pressed, the button has an opacity of `1.0`.
|
|
75
|
+
|
|
76
|
+
Raises:
|
|
77
|
+
ValueError: If [`opacity_on_click`][(c).] is not between `0.0`
|
|
78
|
+
and `1.0` inclusive.
|
|
75
79
|
"""
|
|
76
80
|
|
|
77
81
|
min_size: Optional[Size] = None
|
|
@@ -23,6 +23,17 @@ class CupertinoCheckbox(LayoutControl):
|
|
|
23
23
|
|
|
24
24
|
Checkbox allows to select one or more items from a group,
|
|
25
25
|
or switch between two mutually exclusive options (checked or unchecked, on or off).
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
ft.Column(
|
|
29
|
+
intrinsic_width=True,
|
|
30
|
+
controls=[
|
|
31
|
+
ft.CupertinoCheckbox(),
|
|
32
|
+
ft.CupertinoCheckbox(label="Checked", value=True),
|
|
33
|
+
ft.CupertinoCheckbox(label="Disabled", disabled=True),
|
|
34
|
+
],
|
|
35
|
+
)
|
|
36
|
+
```
|
|
26
37
|
"""
|
|
27
38
|
|
|
28
39
|
label: Optional[str] = None
|
|
@@ -9,10 +9,6 @@ __all__ = ["CupertinoContextMenu"]
|
|
|
9
9
|
class CupertinoContextMenu(AdaptiveControl):
|
|
10
10
|
"""
|
|
11
11
|
A full-screen modal route that opens up when the [`content`][(c).] is long-pressed.
|
|
12
|
-
|
|
13
|
-
Raises:
|
|
14
|
-
ValueError: If [`content`][(c).] is not visible.
|
|
15
|
-
ValueError: If [`actions`][(c).] does not contain at least one visible action.
|
|
16
12
|
"""
|
|
17
13
|
|
|
18
14
|
content: Control
|
|
@@ -23,6 +19,9 @@ class CupertinoContextMenu(AdaptiveControl):
|
|
|
23
19
|
When this context menu is long-pressed, the menu will open and this control
|
|
24
20
|
will be moved to the new route and be expanded. This allows the content
|
|
25
21
|
to resize to fit in its place in the new route, if it doesn't size itself.
|
|
22
|
+
|
|
23
|
+
Raises:
|
|
24
|
+
ValueError: If [`content`][(c).] is not visible.
|
|
26
25
|
"""
|
|
27
26
|
|
|
28
27
|
actions: list[Control]
|
|
@@ -33,6 +32,9 @@ class CupertinoContextMenu(AdaptiveControl):
|
|
|
33
32
|
|
|
34
33
|
Note:
|
|
35
34
|
This list must have at least one visible action.
|
|
35
|
+
|
|
36
|
+
Raises:
|
|
37
|
+
ValueError: If [`actions`][(c).] does not contain at least one visible action.
|
|
36
38
|
"""
|
|
37
39
|
|
|
38
40
|
enable_haptic_feedback: bool = True
|
|
@@ -14,14 +14,14 @@ class CupertinoContextMenuAction(AdaptiveControl):
|
|
|
14
14
|
A cupertino context menu action.
|
|
15
15
|
|
|
16
16
|
Typically used as a child of [`CupertinoContextMenu.actions`][flet.].
|
|
17
|
-
|
|
18
|
-
Raises:
|
|
19
|
-
ValueError: If [`content`][(c).] is neither a string nor a visible Control.
|
|
20
17
|
"""
|
|
21
18
|
|
|
22
19
|
content: StrOrControl
|
|
23
20
|
"""
|
|
24
21
|
The content of this action button.
|
|
22
|
+
|
|
23
|
+
Raises:
|
|
24
|
+
ValueError: If [`content`][(c).] is neither a string nor a visible Control.
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
default: bool = False
|