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
flet/__init__.py
CHANGED
|
@@ -252,6 +252,7 @@ from flet.controls.material.date_picker import (
|
|
|
252
252
|
DatePickerEntryModeChangeEvent,
|
|
253
253
|
DatePickerMode,
|
|
254
254
|
)
|
|
255
|
+
from flet.controls.material.date_range_picker import DateRangePicker
|
|
255
256
|
from flet.controls.material.divider import Divider
|
|
256
257
|
from flet.controls.material.dropdown import Dropdown, DropdownOption
|
|
257
258
|
from flet.controls.material.dropdownm2 import DropdownM2
|
|
@@ -624,6 +625,7 @@ __all__ = [
|
|
|
624
625
|
"DatePickerEntryModeChangeEvent",
|
|
625
626
|
"DatePickerMode",
|
|
626
627
|
"DatePickerTheme",
|
|
628
|
+
"DateRangePicker",
|
|
627
629
|
"DateTimeValue",
|
|
628
630
|
"DecorationImage",
|
|
629
631
|
"DialogControl",
|
|
@@ -10,29 +10,32 @@ __all__ = ["AdaptiveControl"]
|
|
|
10
10
|
class AdaptiveControl(Control):
|
|
11
11
|
"""
|
|
12
12
|
Base class for controls that support adaptive behavior, which allows them to adjust
|
|
13
|
-
their appearance and behavior based on the target platform
|
|
14
|
-
Cupertino design on iOS/macOS).
|
|
13
|
+
their appearance and behavior based on the target platform
|
|
14
|
+
(ex: Material design on Android/Windows/Linux, Cupertino design on iOS/macOS).
|
|
15
15
|
|
|
16
16
|
The [`adaptive`][(c).] property is applicable in two common scenarios:
|
|
17
17
|
|
|
18
18
|
1. **Platform-adaptive controls**:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
These controls have a corresponding version on both Material and Cupertino
|
|
20
|
+
platforms. When `adaptive` is set to `True`, the control renders the
|
|
21
|
+
appropriate platform-specific implementation.
|
|
22
22
|
|
|
23
23
|
2. **Container controls**:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
Controls that contain children (ex: [`Row`][flet.], [`Column`][flet.]) can pass
|
|
25
|
+
the `adaptive` value down to their children that do not explicitly define it
|
|
26
|
+
themselves. This enables nested adaptive behavior in complex layouts.
|
|
27
27
|
|
|
28
|
-
Extension developers can use this base class to create their own adaptive controls
|
|
29
|
-
checking the `adaptive` flag at runtime and rendering accordingly.
|
|
28
|
+
Extension developers can use this base class to create their own adaptive controls
|
|
29
|
+
by checking the `adaptive` flag at runtime and rendering accordingly.
|
|
30
30
|
|
|
31
31
|
Note:
|
|
32
32
|
This class does not implement any platform-specific rendering itself.
|
|
33
|
-
It is up to the control inheriting from it to interpret the [`adaptive`][(c).]
|
|
33
|
+
It is up to the control inheriting from it to interpret the [`adaptive`][(c).]
|
|
34
|
+
flag and render accordingly.
|
|
34
35
|
"""
|
|
36
|
+
|
|
35
37
|
adaptive: Optional[bool] = None
|
|
36
38
|
"""
|
|
37
|
-
Enables platform-specific rendering or inheritance of adaptiveness
|
|
38
|
-
|
|
39
|
+
Enables platform-specific rendering or inheritance of adaptiveness
|
|
40
|
+
from parent controls.
|
|
41
|
+
"""
|
flet/controls/base_page.py
CHANGED
|
@@ -167,8 +167,8 @@ class BasePage(AdaptiveControl):
|
|
|
167
167
|
- This property is read-only.
|
|
168
168
|
- To get or set the full window height including window chrome (e.g.,
|
|
169
169
|
title bar and borders) when running a Flet app on desktop,
|
|
170
|
-
use the [`width`][flet.Window.
|
|
171
|
-
[`Page.window`][flet.
|
|
170
|
+
use the [`width`][flet.Window.] property of
|
|
171
|
+
[`Page.window`][flet.] instead.
|
|
172
172
|
"""
|
|
173
173
|
|
|
174
174
|
height: Optional[Number] = None
|
|
@@ -179,8 +179,8 @@ class BasePage(AdaptiveControl):
|
|
|
179
179
|
- This property is read-only.
|
|
180
180
|
- To get or set the full window height including window chrome (e.g.,
|
|
181
181
|
title bar and borders) when running a Flet app on desktop,
|
|
182
|
-
use the [`height`][flet.Window.
|
|
183
|
-
[`Page.window`][flet.
|
|
182
|
+
use the [`height`][flet.Window.] property of
|
|
183
|
+
[`Page.window`][flet.] instead.
|
|
184
184
|
"""
|
|
185
185
|
|
|
186
186
|
title: Optional[str] = None
|
|
@@ -306,7 +306,7 @@ class BasePage(AdaptiveControl):
|
|
|
306
306
|
This method adds the specified `dialog` to the active dialog stack
|
|
307
307
|
and renders it on the page. If the dialog is already open, an exception
|
|
308
308
|
is raised.
|
|
309
|
-
The [`on_dismiss`][flet.DialogControl.
|
|
309
|
+
The [`on_dismiss`][flet.DialogControl.] handler of the dialog
|
|
310
310
|
is temporarily wrapped to ensure the dialog is removed from the stack and
|
|
311
311
|
its dismissal event is triggered appropriately.
|
|
312
312
|
|
flet/controls/border.py
CHANGED
|
@@ -66,8 +66,9 @@ class BorderSide:
|
|
|
66
66
|
This means that it will render faster than otherwise, but it might
|
|
67
67
|
double-hit pixels, giving it a slightly darker/lighter result.
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
Tip:
|
|
70
|
+
To omit the border entirely, set the [`style`][(c).]
|
|
71
|
+
to [`BorderStyle.NONE`][flet.].
|
|
71
72
|
"""
|
|
72
73
|
|
|
73
74
|
color: ColorValue = Colors.BLACK
|
|
@@ -161,7 +162,7 @@ class Border:
|
|
|
161
162
|
A border comprised of four sides: `top`, `right`, `bottom`, `left`.
|
|
162
163
|
|
|
163
164
|
Each side of the border is an instance of
|
|
164
|
-
[`BorderSide`][flet.
|
|
165
|
+
[`BorderSide`][flet.].
|
|
165
166
|
|
|
166
167
|
Example:
|
|
167
168
|
```python
|
flet/controls/box.py
CHANGED
|
@@ -300,15 +300,13 @@ class BoxDecoration:
|
|
|
300
300
|
|
|
301
301
|
image: Optional[DecorationImage] = None
|
|
302
302
|
"""
|
|
303
|
-
An image to paint above the background [`bgcolor`][
|
|
304
|
-
or [`gradient`][flet.BoxDecoration.gradient].
|
|
303
|
+
An image to paint above the background [`bgcolor`][(c).] or [`gradient`][(c).].
|
|
305
304
|
"""
|
|
306
305
|
|
|
307
306
|
border: Optional[Border] = None
|
|
308
307
|
"""
|
|
309
|
-
A border to draw above the background
|
|
310
|
-
[`
|
|
311
|
-
and [`image`][flet.BoxDecoration.image].
|
|
308
|
+
A border to draw above the background [`bgcolor`][(c).], [`gradient`][(c).],
|
|
309
|
+
and [`image`][(c).].
|
|
312
310
|
"""
|
|
313
311
|
|
|
314
312
|
border_radius: Optional[BorderRadiusValue] = None
|
|
@@ -328,16 +326,13 @@ class BoxDecoration:
|
|
|
328
326
|
|
|
329
327
|
shape: BoxShape = BoxShape.RECTANGLE
|
|
330
328
|
"""
|
|
331
|
-
The shape to fill the [`bgcolor`][
|
|
332
|
-
|
|
333
|
-
flet.BoxDecoration.image] into and to cast as the
|
|
334
|
-
[`shadows`][flet.BoxDecoration.shadows].
|
|
329
|
+
The shape to fill the [`bgcolor`][(c).], [`gradient`][(c).], and [`image`][(c).]
|
|
330
|
+
into and to cast as the [`shadows`][(c).].
|
|
335
331
|
"""
|
|
336
332
|
|
|
337
333
|
blend_mode: Optional[BlendMode] = None
|
|
338
334
|
"""
|
|
339
|
-
The blend mode to apply to the background [`bgcolor`][
|
|
340
|
-
or [`gradient`][flet.BoxDecoration.gradient].
|
|
335
|
+
The blend mode to apply to the background [`bgcolor`][(c).] or [`gradient`][(c).].
|
|
341
336
|
"""
|
|
342
337
|
|
|
343
338
|
def __post_init__(self):
|
flet/controls/buttons.py
CHANGED
|
@@ -34,7 +34,7 @@ class ShapeBorder:
|
|
|
34
34
|
|
|
35
35
|
See subclasses/implementations:
|
|
36
36
|
|
|
37
|
-
- [`OutlinedBorder`][flet.
|
|
37
|
+
- [`OutlinedBorder`][flet.]
|
|
38
38
|
"""
|
|
39
39
|
|
|
40
40
|
|
|
@@ -45,11 +45,11 @@ class OutlinedBorder(ShapeBorder):
|
|
|
45
45
|
|
|
46
46
|
See subclasses/implementations:
|
|
47
47
|
|
|
48
|
-
- [`BeveledRectangleBorder`][flet.
|
|
49
|
-
- [`ContinuousRectangleBorder`][flet.
|
|
50
|
-
- [`CircleBorder`][flet.
|
|
51
|
-
- [`RoundedRectangleBorder`][flet.
|
|
52
|
-
- [`StadiumBorder`][flet.
|
|
48
|
+
- [`BeveledRectangleBorder`][flet.]
|
|
49
|
+
- [`ContinuousRectangleBorder`][flet.]
|
|
50
|
+
- [`CircleBorder`][flet.]
|
|
51
|
+
- [`RoundedRectangleBorder`][flet.]
|
|
52
|
+
- [`StadiumBorder`][flet.]
|
|
53
53
|
"""
|
|
54
54
|
|
|
55
55
|
side: Optional[BorderSide] = None
|
|
@@ -194,7 +194,7 @@ class ButtonStyle:
|
|
|
194
194
|
background and shadow colors, content padding, border width and radius.
|
|
195
195
|
|
|
196
196
|
Most of these style attributes could be configured for all or particular
|
|
197
|
-
[`ControlState`][flet.
|
|
197
|
+
[`ControlState`][flet.] of a button,
|
|
198
198
|
such as `HOVERED`, `FOCUSED`, `DISABLED` and others.
|
|
199
199
|
"""
|
|
200
200
|
|
flet/controls/context.py
CHANGED
|
@@ -10,13 +10,13 @@ class Context:
|
|
|
10
10
|
Manages the context for Flet controls, including page reference
|
|
11
11
|
and auto-update behavior.
|
|
12
12
|
|
|
13
|
-
Context instance is accessed via [`
|
|
13
|
+
Context instance is accessed via [`flet.context`][flet.context].
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
16
|
@property
|
|
17
17
|
def page(self) -> "Page":
|
|
18
18
|
"""
|
|
19
|
-
Returns the current [`Page`][flet.
|
|
19
|
+
Returns the current [`Page`][flet.] associated with the context.
|
|
20
20
|
|
|
21
21
|
For example:
|
|
22
22
|
|
flet/controls/control.py
CHANGED
|
@@ -19,13 +19,16 @@ class Control(BaseControl):
|
|
|
19
19
|
|
|
20
20
|
expand: Optional[Union[bool, int]] = None
|
|
21
21
|
"""
|
|
22
|
-
Specifies whether/how this control should expand to fill available space in its
|
|
22
|
+
Specifies whether/how this control should expand to fill available space in its
|
|
23
|
+
parent layout.
|
|
23
24
|
|
|
24
|
-
More information
|
|
25
|
+
More information
|
|
26
|
+
[here](https://docs.flet-docs.pages.dev/cookbook/expanding-controls/#expand).
|
|
25
27
|
|
|
26
28
|
Note:
|
|
27
|
-
Has effect only if the direct parent of this control is one of the following
|
|
28
|
-
[`Column`][flet.
|
|
29
|
+
Has effect only if the direct parent of this control is one of the following
|
|
30
|
+
controls, or their subclasses: [`Column`][flet.], [`Row`][flet.],
|
|
31
|
+
[`View`][flet.], [`Page`][flet.].
|
|
29
32
|
"""
|
|
30
33
|
|
|
31
34
|
expand_loose: bool = False
|
|
@@ -33,25 +36,28 @@ class Control(BaseControl):
|
|
|
33
36
|
Allows the control to expand along the main axis if space is available,
|
|
34
37
|
but does not require it to fill all available space.
|
|
35
38
|
|
|
36
|
-
More information
|
|
39
|
+
More information
|
|
40
|
+
[here](https://docs.flet-docs.pages.dev/cookbook/expanding-controls/#expand_loose).
|
|
37
41
|
|
|
38
42
|
Note:
|
|
39
43
|
If `expand_loose` is `True`, it will have effect only if:
|
|
40
44
|
|
|
41
45
|
- `expand` is not `None` and
|
|
42
|
-
- the direct parent of this control is one of the following controls, or their
|
|
43
|
-
[`Column`][flet.
|
|
46
|
+
- the direct parent of this control is one of the following controls, or their
|
|
47
|
+
subclasses: [`Column`][flet.], [`Row`][flet.], [`View`][flet.],
|
|
48
|
+
[`Page`][flet.].
|
|
44
49
|
"""
|
|
45
50
|
|
|
46
|
-
|
|
51
|
+
# todo: if dict, validate keys with those in parent (ResponsiveRow.breakpoints)
|
|
52
|
+
col: ResponsiveNumber = 12
|
|
47
53
|
"""
|
|
48
|
-
If a parent of this control is a [`ResponsiveRow`][flet.
|
|
54
|
+
If a parent of this control is a [`ResponsiveRow`][flet.],
|
|
49
55
|
this property is used to determine
|
|
50
56
|
how many virtual columns of a screen this control will span.
|
|
51
57
|
|
|
52
58
|
Can be a number or a dictionary configured to have a different value for specific
|
|
53
59
|
breakpoints, for example `col={"sm": 6}`.
|
|
54
|
-
|
|
60
|
+
|
|
55
61
|
This control spans the 12 virtual columns by default.
|
|
56
62
|
|
|
57
63
|
/// details | Dimensions
|
|
@@ -99,7 +105,8 @@ class Control(BaseControl):
|
|
|
99
105
|
its children are enabled.
|
|
100
106
|
|
|
101
107
|
Note:
|
|
102
|
-
The value of this property will be propagated down to all children controls
|
|
108
|
+
The value of this property will be propagated down to all children controls
|
|
109
|
+
recursively.
|
|
103
110
|
|
|
104
111
|
/// details | Example
|
|
105
112
|
type: example
|
|
@@ -27,39 +27,35 @@ class AnimatedSwitcher(LayoutControl):
|
|
|
27
27
|
|
|
28
28
|
content: Control
|
|
29
29
|
"""
|
|
30
|
-
The content to display.
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
The content to display.
|
|
31
|
+
|
|
32
|
+
When it changes, this switcher will animate the transition from the old/previous
|
|
33
|
+
`content` to the new one.
|
|
33
34
|
"""
|
|
34
35
|
|
|
35
36
|
duration: DurationValue = field(default_factory=lambda: Duration(seconds=1))
|
|
36
37
|
"""
|
|
37
|
-
The duration of the transition from the old
|
|
38
|
-
[`content`][flet.AnimatedSwitcher.content] to the new one.
|
|
38
|
+
The duration of the transition from the old [`content`][(c).] to the new one.
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
41
|
reverse_duration: DurationValue = field(default_factory=lambda: Duration(seconds=1))
|
|
42
42
|
"""
|
|
43
|
-
The duration of the transition from the new
|
|
44
|
-
[`content`][flet.AnimatedSwitcher.content] to the old one.
|
|
43
|
+
The duration of the transition from the new [`content`][(c).] to the old one.
|
|
45
44
|
"""
|
|
46
45
|
|
|
47
46
|
switch_in_curve: AnimationCurve = AnimationCurve.LINEAR
|
|
48
47
|
"""
|
|
49
|
-
The animation curve to use when transitioning in a
|
|
50
|
-
new [`content`][flet.AnimatedSwitcher.content].
|
|
48
|
+
The animation curve to use when transitioning in a new [`content`][(c).].
|
|
51
49
|
"""
|
|
52
50
|
|
|
53
51
|
switch_out_curve: AnimationCurve = AnimationCurve.LINEAR
|
|
54
52
|
"""
|
|
55
|
-
The animation curve to use when transitioning an old
|
|
56
|
-
[`content`][flet.AnimatedSwitcher.content] out.
|
|
53
|
+
The animation curve to use when transitioning an old [`content`][(c).] out.
|
|
57
54
|
"""
|
|
58
55
|
|
|
59
56
|
transition: AnimatedSwitcherTransition = AnimatedSwitcherTransition.FADE
|
|
60
57
|
"""
|
|
61
|
-
An animation type to transition between new and old
|
|
62
|
-
[`content`][flet.AnimatedSwitcher.content].
|
|
58
|
+
An animation type to transition between new and old [`content`][(c).].
|
|
63
59
|
"""
|
|
64
60
|
|
|
65
61
|
def before_update(self):
|
|
@@ -45,7 +45,7 @@ class Canvas(LayoutControl):
|
|
|
45
45
|
"""
|
|
46
46
|
Sampling interval in milliseconds for `on_resize` event.
|
|
47
47
|
|
|
48
|
-
Setting to `0` calls [`on_resize`][
|
|
48
|
+
Setting to `0` calls [`on_resize`][(c).] immediately
|
|
49
49
|
on every change.
|
|
50
50
|
"""
|
|
51
51
|
|
|
@@ -14,9 +14,8 @@ class Line(Shape):
|
|
|
14
14
|
Draws a line between the given points using the given paint.
|
|
15
15
|
|
|
16
16
|
Note:
|
|
17
|
-
The line is always rendered as a stroke,
|
|
18
|
-
|
|
19
|
-
[`style`][flet.Paint.style] property.
|
|
17
|
+
The line is always rendered as a stroke, regardless of the value
|
|
18
|
+
of [`paint`][(c).]'s [`style`][flet.Paint.] property.
|
|
20
19
|
"""
|
|
21
20
|
|
|
22
21
|
x1: Number
|
|
@@ -14,7 +14,7 @@ class Oval(Shape):
|
|
|
14
14
|
Draws an axis-aligned oval that fills the given
|
|
15
15
|
axis-aligned rectangle with the given [`paint`][(c).].
|
|
16
16
|
|
|
17
|
-
The [`style`][flet.Paint.
|
|
17
|
+
The [`style`][flet.Paint.] property of [`paint`][(c).] indicates
|
|
18
18
|
whether this oval is filled, stroked, or both.
|
|
19
19
|
"""
|
|
20
20
|
|
|
@@ -9,14 +9,14 @@ class Shape(BaseControl):
|
|
|
9
9
|
|
|
10
10
|
See subclasses/implementations:
|
|
11
11
|
|
|
12
|
-
- [`Arc`][flet.canvas.
|
|
13
|
-
- [`Circle`][flet.canvas.
|
|
14
|
-
- [`Color`][flet.canvas.
|
|
15
|
-
- [`Fill`][flet.canvas.
|
|
16
|
-
- [`Line`][flet.canvas.
|
|
17
|
-
- [`Oval`][flet.canvas.
|
|
18
|
-
- [`Path`][flet.canvas.
|
|
19
|
-
- [`Points`][flet.canvas.
|
|
20
|
-
- [`Rect`][flet.canvas.
|
|
21
|
-
- [`Text`][flet.canvas.
|
|
12
|
+
- [`Arc`][flet.canvas.]
|
|
13
|
+
- [`Circle`][flet.canvas.]
|
|
14
|
+
- [`Color`][flet.canvas.]
|
|
15
|
+
- [`Fill`][flet.canvas.]
|
|
16
|
+
- [`Line`][flet.canvas.]
|
|
17
|
+
- [`Oval`][flet.canvas.]
|
|
18
|
+
- [`Path`][flet.canvas.]
|
|
19
|
+
- [`Points`][flet.canvas.]
|
|
20
|
+
- [`Rect`][flet.canvas.]
|
|
21
|
+
- [`Text`][flet.canvas.]
|
|
22
22
|
"""
|
flet/controls/core/column.py
CHANGED
|
@@ -29,14 +29,14 @@ class Column(LayoutControl, ScrollableControl, AdaptiveControl):
|
|
|
29
29
|
|
|
30
30
|
horizontal_alignment: CrossAxisAlignment = CrossAxisAlignment.START
|
|
31
31
|
"""
|
|
32
|
-
Defines how the [`controls`][
|
|
32
|
+
Defines how the [`controls`][(c).] should be placed horizontally.
|
|
33
33
|
"""
|
|
34
34
|
|
|
35
35
|
spacing: Number = 10
|
|
36
36
|
"""
|
|
37
37
|
Spacing between the `controls`.
|
|
38
38
|
|
|
39
|
-
It is applied only when [`alignment`][
|
|
39
|
+
It is applied only when [`alignment`][(c).] is
|
|
40
40
|
`MainAxisAlignment.START`, `MainAxisAlignment.END` or `MainAxisAlignment.CENTER`.
|
|
41
41
|
"""
|
|
42
42
|
|
|
@@ -50,18 +50,18 @@ class Column(LayoutControl, ScrollableControl, AdaptiveControl):
|
|
|
50
50
|
|
|
51
51
|
wrap: bool = False
|
|
52
52
|
"""
|
|
53
|
-
Whether the [`controls`][
|
|
53
|
+
Whether the [`controls`][(c).] should wrap into additional
|
|
54
54
|
columns (runs) when they don't fit in a single vertical column.
|
|
55
55
|
"""
|
|
56
56
|
|
|
57
57
|
run_spacing: Number = 10
|
|
58
58
|
"""
|
|
59
|
-
The spacing between runs when [`wrap`][
|
|
59
|
+
The spacing between runs when [`wrap`][(c).] is `True`.
|
|
60
60
|
"""
|
|
61
61
|
|
|
62
62
|
run_alignment: MainAxisAlignment = MainAxisAlignment.START
|
|
63
63
|
"""
|
|
64
|
-
How the runs should be placed in the cross-axis when [`wrap`][
|
|
64
|
+
How the runs should be placed in the cross-axis when [`wrap`][(c).]
|
|
65
65
|
is `True`.
|
|
66
66
|
"""
|
|
67
67
|
|
|
@@ -58,20 +58,20 @@ class Dismissible(LayoutControl, AdaptiveControl):
|
|
|
58
58
|
|
|
59
59
|
background: Optional[Control] = None
|
|
60
60
|
"""
|
|
61
|
-
A control that is stacked behind the [`content`][
|
|
61
|
+
A control that is stacked behind the [`content`][(c).].
|
|
62
62
|
|
|
63
|
-
If [`secondary_background`][
|
|
63
|
+
If [`secondary_background`][(c).] is also
|
|
64
64
|
specified, then this control only appears when the content has been dragged
|
|
65
65
|
down or to the right.
|
|
66
66
|
"""
|
|
67
67
|
|
|
68
68
|
secondary_background: Optional[Control] = None
|
|
69
69
|
"""
|
|
70
|
-
A control that is stacked behind the [`content`][
|
|
70
|
+
A control that is stacked behind the [`content`][(c).] and is
|
|
71
71
|
exposed when it has been dragged up or to the left.
|
|
72
72
|
|
|
73
73
|
Note:
|
|
74
|
-
Can only be specified if [`background`][
|
|
74
|
+
Can only be specified if [`background`][(c).] is also
|
|
75
75
|
specified/visible.
|
|
76
76
|
"""
|
|
77
77
|
|
|
@@ -86,7 +86,7 @@ class Dismissible(LayoutControl, AdaptiveControl):
|
|
|
86
86
|
"""
|
|
87
87
|
The offset threshold the item has to be dragged in order to be considered
|
|
88
88
|
as dismissed. This is specified as a dictionary where the key is of
|
|
89
|
-
type [`DismissDirection`][flet.
|
|
89
|
+
type [`DismissDirection`][flet.] and the value is the threshold
|
|
90
90
|
(a fractional/decimal value between `0.0` and `1.0`, inclusive).
|
|
91
91
|
|
|
92
92
|
Example:
|
|
@@ -105,7 +105,7 @@ class Dismissible(LayoutControl, AdaptiveControl):
|
|
|
105
105
|
default_factory=lambda: Duration(milliseconds=200)
|
|
106
106
|
)
|
|
107
107
|
"""
|
|
108
|
-
The duration for [`content`][
|
|
108
|
+
The duration for [`content`][(c).] to dismiss or
|
|
109
109
|
to come back to original position if not dismissed.
|
|
110
110
|
"""
|
|
111
111
|
|
|
@@ -114,13 +114,13 @@ class Dismissible(LayoutControl, AdaptiveControl):
|
|
|
114
114
|
)
|
|
115
115
|
"""
|
|
116
116
|
The amount of time the control will spend contracting
|
|
117
|
-
before [`on_dismiss`][
|
|
117
|
+
before [`on_dismiss`][(c).] is called.
|
|
118
118
|
"""
|
|
119
119
|
|
|
120
120
|
cross_axis_end_offset: Number = 0.0
|
|
121
121
|
"""
|
|
122
122
|
Specifies the end offset along the main axis once the
|
|
123
|
-
[`content`][
|
|
123
|
+
[`content`][(c).] has been dismissed.
|
|
124
124
|
|
|
125
125
|
If set to a non-zero value, then this dismissible moves in cross direction
|
|
126
126
|
depending on whether it is positive or negative.
|
|
@@ -9,8 +9,8 @@ from flet.controls.transform import Offset
|
|
|
9
9
|
__all__ = [
|
|
10
10
|
"DragTarget",
|
|
11
11
|
"DragTargetEvent",
|
|
12
|
-
"DragWillAcceptEvent",
|
|
13
12
|
"DragTargetLeaveEvent",
|
|
13
|
+
"DragWillAcceptEvent",
|
|
14
14
|
]
|
|
15
15
|
|
|
16
16
|
|
|
@@ -39,7 +39,8 @@ class DragTargetLeaveEvent(Event["DragTarget"]):
|
|
|
39
39
|
@control("DragTarget")
|
|
40
40
|
class DragTarget(Control):
|
|
41
41
|
"""
|
|
42
|
-
A control that completes drag operation when a [`Draggable`][flet.
|
|
42
|
+
A control that completes drag operation when a [`Draggable`][flet.] control
|
|
43
|
+
is dropped.
|
|
43
44
|
|
|
44
45
|
When a `Draggable` is dragged on top of a `DragTarget`, the `DragTarget` is asked
|
|
45
46
|
whether it will accept the data the `Draggable` is carrying. The `DragTarget` will
|
|
@@ -62,7 +63,7 @@ class DragTarget(Control):
|
|
|
62
63
|
The group this target belongs to.
|
|
63
64
|
|
|
64
65
|
Note:
|
|
65
|
-
For a `DragTarget` to accept an incoming drop from a [`Draggable`][flet.
|
|
66
|
+
For a `DragTarget` to accept an incoming drop from a [`Draggable`][flet.],
|
|
66
67
|
they must both be in the same `group`.
|
|
67
68
|
"""
|
|
68
69
|
|
|
@@ -73,7 +74,7 @@ class DragTarget(Control):
|
|
|
73
74
|
|
|
74
75
|
on_accept: Optional[EventHandler[DragTargetEvent]] = None
|
|
75
76
|
"""
|
|
76
|
-
Called when the user does drop an acceptable (same [`group`][
|
|
77
|
+
Called when the user does drop an acceptable (same [`group`][(c).]) draggable on
|
|
77
78
|
this target.
|
|
78
79
|
|
|
79
80
|
Use `page.get_control(e.src_id)` to retrieve Control reference by its ID.
|
flet/controls/core/draggable.py
CHANGED
|
@@ -11,12 +11,12 @@ __all__ = ["Draggable"]
|
|
|
11
11
|
@control("Draggable")
|
|
12
12
|
class Draggable(Control):
|
|
13
13
|
"""
|
|
14
|
-
A control that can be dragged from to a [`DragTarget`][flet.
|
|
14
|
+
A control that can be dragged from to a [`DragTarget`][flet.].
|
|
15
15
|
|
|
16
16
|
When a draggable control recognizes the start of a drag gesture, it displays the
|
|
17
|
-
[`content_feedback`][(c).] control that tracks the user's finger across the screen.
|
|
18
|
-
user lifts their finger while on top of a `DragTarget`, this target is
|
|
19
|
-
opportunity to complete drag-and-drop flow.
|
|
17
|
+
[`content_feedback`][(c).] control that tracks the user's finger across the screen.
|
|
18
|
+
If the user lifts their finger while on top of a `DragTarget`, this target is
|
|
19
|
+
given the opportunity to complete drag-and-drop flow.
|
|
20
20
|
|
|
21
21
|
Raises:
|
|
22
22
|
AssertionError: If [`content`][(c).] is not visible.
|
|
@@ -28,7 +28,7 @@ class Draggable(Control):
|
|
|
28
28
|
The control to display when the draggable is not being dragged.
|
|
29
29
|
|
|
30
30
|
If the draggable is being dragged, the
|
|
31
|
-
[`content_when_dragging`][
|
|
31
|
+
[`content_when_dragging`][(c).] is displayed instead.
|
|
32
32
|
"""
|
|
33
33
|
|
|
34
34
|
group: str = "default"
|
|
@@ -36,13 +36,14 @@ class Draggable(Control):
|
|
|
36
36
|
The group this draggable belongs to.
|
|
37
37
|
|
|
38
38
|
Note:
|
|
39
|
-
For a [`DragTarget`][flet.
|
|
39
|
+
For a [`DragTarget`][flet.] to accept an incoming drop from a `Draggable`,
|
|
40
40
|
they must both be in the same `group`.
|
|
41
41
|
"""
|
|
42
42
|
|
|
43
43
|
content_when_dragging: Optional[Control] = None
|
|
44
44
|
"""
|
|
45
|
-
The control to display instead of [`content`][
|
|
45
|
+
The control to display instead of [`content`][(c).] when this draggable
|
|
46
|
+
is being dragged.
|
|
46
47
|
|
|
47
48
|
If set, this control visually replaces `content` during an active drag operation,
|
|
48
49
|
allowing you to show a different appearance or an "empty" placeholder.
|
|
@@ -65,11 +66,14 @@ class Draggable(Control):
|
|
|
65
66
|
|
|
66
67
|
affinity: Optional[Axis] = None
|
|
67
68
|
"""
|
|
68
|
-
Specifies the axis along which this control competes with other gestures to
|
|
69
|
+
Specifies the axis along which this control competes with other gestures to
|
|
70
|
+
initiate a drag.
|
|
69
71
|
|
|
70
|
-
- If `None`, the drag starts as soon as a tap down gesture is recognized,
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
- If `None`, the drag starts as soon as a tap down gesture is recognized,
|
|
73
|
+
regardless of direction.
|
|
74
|
+
- If set to `Axis.HORIZONTAL` or `Axis.VERTICAL`, the control will only initiate a
|
|
75
|
+
drag when the gesture matches the specified axis, allowing it to compete
|
|
76
|
+
with other gestures in that direction.
|
|
73
77
|
"""
|
|
74
78
|
|
|
75
79
|
max_simultaneous_drags: Optional[int] = None
|
|
@@ -79,7 +83,7 @@ class Draggable(Control):
|
|
|
79
83
|
- `0` - disables dragging entirely.
|
|
80
84
|
- `1` - allows only one drag at a time.
|
|
81
85
|
For a better user experience, you may want to provide an "empty" widget for
|
|
82
|
-
[`content_when_dragging`][
|
|
86
|
+
[`content_when_dragging`][(c).]
|
|
83
87
|
to visually indicate the item is being moved.
|
|
84
88
|
- Set to any positive integer to allow that many concurrent drags.
|
|
85
89
|
- If `None`, there is no limit on the number of simultaneous drags.
|
|
@@ -92,7 +96,7 @@ class Draggable(Control):
|
|
|
92
96
|
|
|
93
97
|
on_drag_complete: Optional[ControlEventHandler["Draggable"]] = None
|
|
94
98
|
"""
|
|
95
|
-
Called when this draggable is dropped and accepted by a [`DragTarget`][flet.
|
|
99
|
+
Called when this draggable is dropped and accepted by a [`DragTarget`][flet.].
|
|
96
100
|
"""
|
|
97
101
|
|
|
98
102
|
def before_update(self):
|
|
@@ -101,5 +105,6 @@ class Draggable(Control):
|
|
|
101
105
|
assert self.max_simultaneous_drags is None or (
|
|
102
106
|
self.max_simultaneous_drags >= 0
|
|
103
107
|
), (
|
|
104
|
-
f"max_simultaneous_drags must be greater than or equal to 0,
|
|
108
|
+
f"max_simultaneous_drags must be greater than or equal to 0, "
|
|
109
|
+
f"got {self.max_simultaneous_drags}"
|
|
105
110
|
)
|
flet/controls/core/grid_view.py
CHANGED
|
@@ -18,8 +18,8 @@ class GridView(LayoutControl, ScrollableControl, AdaptiveControl):
|
|
|
18
18
|
A scrollable, 2D array of controls.
|
|
19
19
|
|
|
20
20
|
It is very effective for large lists (thousands of items).
|
|
21
|
-
Prefer it over wrapping [`Column`][flet.
|
|
22
|
-
[`Row`][flet.
|
|
21
|
+
Prefer it over wrapping [`Column`][flet.]s or
|
|
22
|
+
[`Row`][flet.]s for smooth scrolling.
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
25
|
controls: list[Control] = field(default_factory=list)
|
flet/controls/core/image.py
CHANGED
|
@@ -87,7 +87,7 @@ class Image(LayoutControl):
|
|
|
87
87
|
color: Optional[ColorValue] = None
|
|
88
88
|
"""
|
|
89
89
|
If set, this color is blended with each
|
|
90
|
-
image pixel using [`color_blend_mode`][
|
|
90
|
+
image pixel using [`color_blend_mode`][(c).].
|
|
91
91
|
"""
|
|
92
92
|
|
|
93
93
|
color_blend_mode: Optional[BlendMode] = None
|
|
@@ -62,7 +62,7 @@ class InteractiveViewer(LayoutControl):
|
|
|
62
62
|
The maximum allowed scale.
|
|
63
63
|
|
|
64
64
|
Note:
|
|
65
|
-
Must be greater than or equal to [`min_scale`][
|
|
65
|
+
Must be greater than or equal to [`min_scale`][(c).].
|
|
66
66
|
""" # noqa: E501
|
|
67
67
|
|
|
68
68
|
min_scale: Number = 0.8
|
|
@@ -71,7 +71,7 @@ class InteractiveViewer(LayoutControl):
|
|
|
71
71
|
|
|
72
72
|
Note:
|
|
73
73
|
Must be greater than `0` and less than or equal
|
|
74
|
-
to [`max_scale`][
|
|
74
|
+
to [`max_scale`][(c).].
|
|
75
75
|
"""
|
|
76
76
|
|
|
77
77
|
interaction_end_friction_coefficient: Number = 0.0000135
|