flet 0.70.0.dev5771__py3-none-any.whl → 0.70.0.dev5776__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/control.py +12 -6
- flet/controls/core/animated_switcher.py +3 -2
- flet/controls/core/autofill_group.py +6 -2
- flet/controls/core/dismissible.py +12 -10
- flet/controls/core/drag_target.py +3 -2
- flet/controls/core/draggable.py +9 -9
- flet/controls/core/icon.py +16 -12
- flet/controls/core/interactive_viewer.py +24 -23
- flet/controls/core/pagelet.py +3 -2
- flet/controls/core/reorderable_draggable.py +3 -2
- flet/controls/core/safe_area.py +3 -2
- flet/controls/core/text_span.py +5 -3
- flet/controls/core/window_drag_area.py +3 -2
- flet/controls/cupertino/cupertino_action_sheet.py +10 -5
- flet/controls/cupertino/cupertino_action_sheet_action.py +3 -4
- flet/controls/cupertino/cupertino_activity_indicator.py +4 -3
- flet/controls/cupertino/cupertino_alert_dialog.py +6 -3
- flet/controls/cupertino/cupertino_button.py +6 -5
- flet/controls/cupertino/cupertino_context_menu.py +8 -4
- flet/controls/cupertino/cupertino_context_menu_action.py +3 -4
- flet/controls/cupertino/cupertino_date_picker.py +44 -28
- flet/controls/cupertino/cupertino_dialog_action.py +3 -4
- flet/controls/cupertino/cupertino_list_tile.py +3 -4
- flet/controls/cupertino/cupertino_navigation_bar.py +6 -5
- flet/controls/cupertino/cupertino_picker.py +14 -10
- flet/controls/cupertino/cupertino_segmented_button.py +6 -5
- flet/controls/cupertino/cupertino_slider.py +16 -12
- flet/controls/cupertino/cupertino_sliding_segmented_button.py +6 -5
- flet/controls/cupertino/cupertino_timer_picker.py +38 -31
- flet/controls/material/alert_dialog.py +6 -5
- flet/controls/material/app_bar.py +17 -14
- flet/controls/material/banner.py +13 -11
- flet/controls/material/bottom_app_bar.py +5 -4
- flet/controls/material/bottom_sheet.py +5 -4
- flet/controls/material/button.py +12 -4
- flet/controls/material/chip.py +13 -12
- flet/controls/material/circle_avatar.py +17 -13
- flet/controls/material/datatable.py +48 -41
- flet/controls/material/divider.py +24 -14
- flet/controls/material/dropdown.py +5 -3
- flet/controls/material/expansion_tile.py +11 -22
- flet/controls/material/floating_action_button.py +32 -23
- flet/controls/material/icon_button.py +7 -3
- flet/controls/material/navigation_rail.py +14 -11
- flet/controls/material/outlined_button.py +7 -3
- flet/controls/material/progress_bar.py +18 -10
- flet/controls/material/radio_group.py +5 -1
- flet/controls/material/range_slider.py +13 -13
- flet/controls/material/segmented_button.py +21 -17
- flet/controls/material/selection_area.py +3 -2
- flet/controls/material/slider.py +16 -12
- flet/controls/material/snack_bar.py +18 -10
- flet/controls/material/switch.py +6 -5
- flet/controls/material/tabs.py +18 -14
- flet/controls/material/textfield.py +22 -14
- flet/controls/material/vertical_divider.py +14 -12
- flet/controls/page.py +2 -1
- flet/testing/finder.py +2 -0
- flet/testing/flet_test_app.py +2 -0
- flet/version.py +1 -1
- {flet-0.70.0.dev5771.dist-info → flet-0.70.0.dev5776.dist-info}/METADATA +5 -5
- {flet-0.70.0.dev5771.dist-info → flet-0.70.0.dev5776.dist-info}/RECORD +65 -65
- {flet-0.70.0.dev5771.dist-info → flet-0.70.0.dev5776.dist-info}/WHEEL +0 -0
- {flet-0.70.0.dev5771.dist-info → flet-0.70.0.dev5776.dist-info}/entry_points.txt +0 -0
- {flet-0.70.0.dev5771.dist-info → flet-0.70.0.dev5776.dist-info}/top_level.txt +0 -0
|
@@ -23,7 +23,7 @@ class Segment(Control):
|
|
|
23
23
|
A segment for a [`SegmentedButton`][flet.].
|
|
24
24
|
|
|
25
25
|
Raises:
|
|
26
|
-
|
|
26
|
+
ValueError: If neither [`icon`][(c).] nor [`label`][(c).] is set.
|
|
27
27
|
"""
|
|
28
28
|
|
|
29
29
|
value: str
|
|
@@ -45,12 +45,13 @@ class Segment(Control):
|
|
|
45
45
|
|
|
46
46
|
def before_update(self):
|
|
47
47
|
super().before_update()
|
|
48
|
-
|
|
48
|
+
if not (
|
|
49
49
|
(isinstance(self.icon, IconData))
|
|
50
50
|
or (isinstance(self.icon, Control) and self.icon.visible)
|
|
51
51
|
or (isinstance(self.label, str))
|
|
52
52
|
or (isinstance(self.label, Control) and self.label.visible)
|
|
53
|
-
)
|
|
53
|
+
):
|
|
54
|
+
raise ValueError("one of icon or label must be set and visible")
|
|
54
55
|
|
|
55
56
|
|
|
56
57
|
@control("SegmentedButton")
|
|
@@ -59,11 +60,13 @@ class SegmentedButton(LayoutControl):
|
|
|
59
60
|
A segmented button control.
|
|
60
61
|
|
|
61
62
|
Raises:
|
|
62
|
-
|
|
63
|
+
ValueError: If [`segments`][(c).] is empty or does not have at
|
|
63
64
|
least one visible `Segment`.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
ValueError: If [`selected`][(c).] is empty and
|
|
66
|
+
[`allow_empty_selection`][(c).] is `False`.
|
|
67
|
+
ValueError: If [`selected`][(c).] has more than one item and
|
|
68
|
+
[`allow_multiple_selection`][(c).] is `False`.
|
|
69
|
+
"""
|
|
67
70
|
|
|
68
71
|
segments: list[Segment]
|
|
69
72
|
"""
|
|
@@ -153,13 +156,14 @@ class SegmentedButton(LayoutControl):
|
|
|
153
156
|
|
|
154
157
|
def before_update(self):
|
|
155
158
|
super().before_update()
|
|
156
|
-
|
|
157
|
-
"segments must have at minimum one visible Segment"
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
159
|
+
if not any(segment.visible for segment in self.segments):
|
|
160
|
+
raise ValueError("segments must have at minimum one visible Segment")
|
|
161
|
+
if len(self.selected) == 0 and not self.allow_empty_selection:
|
|
162
|
+
raise ValueError(
|
|
163
|
+
"allow_empty_selection must be True for selected to be empty"
|
|
164
|
+
)
|
|
165
|
+
if len(self.selected) >= 2 and not self.allow_multiple_selection:
|
|
166
|
+
raise ValueError(
|
|
167
|
+
"allow_multiple_selection must be True for selected to "
|
|
168
|
+
"have more than one item"
|
|
169
|
+
)
|
|
@@ -14,7 +14,7 @@ class SelectionArea(Control):
|
|
|
14
14
|
selection for its child control.
|
|
15
15
|
|
|
16
16
|
Raises:
|
|
17
|
-
|
|
17
|
+
ValueError: If [`content`][(c).] is not visible
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
content: Control
|
|
@@ -33,4 +33,5 @@ class SelectionArea(Control):
|
|
|
33
33
|
|
|
34
34
|
def before_update(self):
|
|
35
35
|
super().before_update()
|
|
36
|
-
|
|
36
|
+
if not self.content.visible:
|
|
37
|
+
raise ValueError("content must be visible")
|
flet/controls/material/slider.py
CHANGED
|
@@ -34,9 +34,9 @@ class Slider(LayoutControl, AdaptiveControl):
|
|
|
34
34
|
of setting changes.
|
|
35
35
|
|
|
36
36
|
Raises:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
ValueError: If [`min`][(c).] is greater than [`max`][(c).].
|
|
38
|
+
ValueError: If [`value`][(c).] is less than [`min`][(c).].
|
|
39
|
+
ValueError: If [`value`][(c).] is greater than [`max`][(c).].
|
|
40
40
|
"""
|
|
41
41
|
|
|
42
42
|
value: Optional[Number] = None
|
|
@@ -216,12 +216,16 @@ class Slider(LayoutControl, AdaptiveControl):
|
|
|
216
216
|
|
|
217
217
|
def before_update(self):
|
|
218
218
|
super().before_update()
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
219
|
+
if self.max is not None and self.min > self.max:
|
|
220
|
+
raise ValueError(
|
|
221
|
+
f"min ({self.min}) must be less than or equal to max ({self.max})"
|
|
222
|
+
)
|
|
223
|
+
if self.value is not None and self.value < self.min:
|
|
224
|
+
raise ValueError(
|
|
225
|
+
f"value ({self.value}) must be greater than or "
|
|
226
|
+
f"equal to min ({self.min})"
|
|
227
|
+
)
|
|
228
|
+
if self.value is not None and self.value > self.max:
|
|
229
|
+
raise ValueError(
|
|
230
|
+
f"value ({self.value}) must be less than or equal to max ({self.max})"
|
|
231
|
+
)
|
|
@@ -93,6 +93,11 @@ class SnackBar(DialogControl):
|
|
|
93
93
|
"""
|
|
94
94
|
A lightweight message with an optional action which briefly displays at the
|
|
95
95
|
bottom of the screen.
|
|
96
|
+
|
|
97
|
+
Raises:
|
|
98
|
+
ValueError: If [`content`][(c).] is not a string or visible control.
|
|
99
|
+
ValueError: If [`action_overflow_threshold`][(c).] is not between 0 and 1.
|
|
100
|
+
ValueError: If [`elevation`][(c).] is negative.
|
|
96
101
|
"""
|
|
97
102
|
|
|
98
103
|
content: StrOrControl
|
|
@@ -229,13 +234,16 @@ class SnackBar(DialogControl):
|
|
|
229
234
|
|
|
230
235
|
def before_update(self):
|
|
231
236
|
super().before_update()
|
|
232
|
-
|
|
233
|
-
isinstance(self.content,
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
237
|
+
if not (
|
|
238
|
+
isinstance(self.content, str)
|
|
239
|
+
or (isinstance(self.content, Control) and self.content.visible)
|
|
240
|
+
):
|
|
241
|
+
raise ValueError("content must be a string or a visible control")
|
|
242
|
+
if self.action_overflow_threshold is not None and not (
|
|
243
|
+
0 <= self.action_overflow_threshold <= 1
|
|
244
|
+
):
|
|
245
|
+
raise ValueError(
|
|
246
|
+
"action_overflow_threshold must be between 0 and 1 inclusive"
|
|
247
|
+
)
|
|
248
|
+
if self.elevation is not None and self.elevation < 0:
|
|
249
|
+
raise ValueError("elevation cannot be negative")
|
flet/controls/material/switch.py
CHANGED
|
@@ -28,7 +28,7 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
28
28
|
For example, "On/Off", "Show/Hide".
|
|
29
29
|
|
|
30
30
|
Raises:
|
|
31
|
-
|
|
31
|
+
ValueError: If [`splash_radius`][(c).] is negative.
|
|
32
32
|
"""
|
|
33
33
|
|
|
34
34
|
label: Optional[StrOrControl] = None
|
|
@@ -225,7 +225,8 @@ class Switch(LayoutControl, AdaptiveControl):
|
|
|
225
225
|
|
|
226
226
|
def before_update(self):
|
|
227
227
|
super().before_update()
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
228
|
+
if self.splash_radius is not None and self.splash_radius < 0:
|
|
229
|
+
raise ValueError(
|
|
230
|
+
"splash_radius must be greater than or equal to 0, "
|
|
231
|
+
f"got {self.splash_radius}"
|
|
232
|
+
)
|
flet/controls/material/tabs.py
CHANGED
|
@@ -316,9 +316,9 @@ class TabBar(LayoutControl, AdaptiveControl):
|
|
|
316
316
|
on text headers to articulate the different sections of content.
|
|
317
317
|
|
|
318
318
|
Raises:
|
|
319
|
-
|
|
319
|
+
ValueError: If [`indicator`][(c).] is None and
|
|
320
320
|
[`indicator_thickness`][(c).] is not strictly greater than 0.
|
|
321
|
-
|
|
321
|
+
ValueError: If [`tab_alignment`][(c).] is not valid for
|
|
322
322
|
the given [`scrollable`][(c).] state.
|
|
323
323
|
"""
|
|
324
324
|
|
|
@@ -538,20 +538,25 @@ class TabBar(LayoutControl, AdaptiveControl):
|
|
|
538
538
|
|
|
539
539
|
def before_update(self):
|
|
540
540
|
super().before_update()
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
541
|
+
if self.indicator is None and self.indicator_thickness <= 0.0:
|
|
542
|
+
raise ValueError(
|
|
543
|
+
f"indicator_thickness must be strictly greater than zero if indicator "
|
|
544
|
+
f"is None, got {self.indicator_thickness}"
|
|
545
|
+
)
|
|
545
546
|
valid_alignments = (
|
|
546
547
|
[TabAlignment.CENTER, TabAlignment.FILL]
|
|
547
548
|
if not self.scrollable
|
|
548
549
|
else [TabAlignment.START, TabAlignment.START_OFFSET, TabAlignment.CENTER]
|
|
549
550
|
)
|
|
550
551
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
)
|
|
552
|
+
if (
|
|
553
|
+
self.tab_alignment is not None
|
|
554
|
+
and self.tab_alignment not in valid_alignments
|
|
555
|
+
):
|
|
556
|
+
raise ValueError(
|
|
557
|
+
f"If scrollable is {self.scrollable}, tab_alignment must be one of: "
|
|
558
|
+
f"{', '.join(f'TabAlignment.{a.name}' for a in valid_alignments)}."
|
|
559
|
+
)
|
|
555
560
|
|
|
556
561
|
|
|
557
562
|
@control("Tab")
|
|
@@ -560,7 +565,7 @@ class Tab(AdaptiveControl):
|
|
|
560
565
|
A Material Design [`TabBar`][flet.] tab.
|
|
561
566
|
|
|
562
567
|
Raises:
|
|
563
|
-
|
|
568
|
+
ValueError: If both [`label`][(c).] and [`icon`][(c).] are not set.
|
|
564
569
|
"""
|
|
565
570
|
|
|
566
571
|
label: Optional[StrOrControl] = None
|
|
@@ -599,6 +604,5 @@ class Tab(AdaptiveControl):
|
|
|
599
604
|
|
|
600
605
|
def before_update(self):
|
|
601
606
|
super().before_update()
|
|
602
|
-
|
|
603
|
-
"Tab must have at least label or icon property set"
|
|
604
|
-
)
|
|
607
|
+
if not ((self.label is not None) or (self.icon is not None)):
|
|
608
|
+
raise ValueError("Tab must have at least label or icon property set")
|
|
@@ -133,6 +133,12 @@ class TextField(FormFieldControl, AdaptiveControl):
|
|
|
133
133
|
"""
|
|
134
134
|
A text field lets the user enter text, either with hardware keyboard or with an
|
|
135
135
|
onscreen keyboard.
|
|
136
|
+
|
|
137
|
+
Raises:
|
|
138
|
+
ValueError: If [`min_lines`][(c).] is not positive.
|
|
139
|
+
ValueError: If [`max_lines`][(c).] is not positive.
|
|
140
|
+
ValueError: If [`min_lines`][(c).] is greater than [`max_lines`][(c).].
|
|
141
|
+
ValueError: If [`max_length`][(c).] is not -1 or positive.
|
|
136
142
|
"""
|
|
137
143
|
|
|
138
144
|
value: str = ""
|
|
@@ -420,20 +426,22 @@ class TextField(FormFieldControl, AdaptiveControl):
|
|
|
420
426
|
|
|
421
427
|
def before_update(self):
|
|
422
428
|
super().before_update()
|
|
423
|
-
|
|
424
|
-
"min_lines must be greater than 0"
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
self.
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
429
|
+
if self.min_lines is not None and self.min_lines <= 0:
|
|
430
|
+
raise ValueError("min_lines must be greater than 0")
|
|
431
|
+
if self.max_lines is not None and self.max_lines <= 0:
|
|
432
|
+
raise ValueError("max_lines must be greater than 0")
|
|
433
|
+
if (
|
|
434
|
+
self.max_lines is not None
|
|
435
|
+
and self.min_lines is not None
|
|
436
|
+
and self.min_lines > self.max_lines
|
|
437
|
+
):
|
|
438
|
+
raise ValueError("min_lines can't be greater than max_lines")
|
|
439
|
+
if (
|
|
440
|
+
self.max_length is not None
|
|
441
|
+
and self.max_length != -1
|
|
442
|
+
and self.max_length <= 0
|
|
443
|
+
):
|
|
444
|
+
raise ValueError("max_length must be either equal to -1 or greater than 0")
|
|
437
445
|
if (
|
|
438
446
|
self.bgcolor is not None
|
|
439
447
|
or self.fill_color is not None
|
|
@@ -13,6 +13,12 @@ class VerticalDivider(Control):
|
|
|
13
13
|
A thin vertical line, with padding on either side.
|
|
14
14
|
|
|
15
15
|
In the material design language, this represents a divider.
|
|
16
|
+
|
|
17
|
+
Raises:
|
|
18
|
+
ValueError: If [`width`][(c).] is negative.
|
|
19
|
+
ValueError: If [`thickness`][(c).] is negative.
|
|
20
|
+
ValueError: If [`leading_indent`][(c).] is negative.
|
|
21
|
+
ValueError: If [`trailing_indent`][(c).] is negative.
|
|
16
22
|
"""
|
|
17
23
|
|
|
18
24
|
width: Optional[Number] = None
|
|
@@ -63,15 +69,11 @@ class VerticalDivider(Control):
|
|
|
63
69
|
|
|
64
70
|
def before_update(self):
|
|
65
71
|
super().before_update()
|
|
66
|
-
|
|
67
|
-
"width must be greater than or equal to 0"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
)
|
|
75
|
-
assert self.trailing_indent is None or self.trailing_indent >= 0, (
|
|
76
|
-
"trailing_indent must be greater than or equal to 0"
|
|
77
|
-
)
|
|
72
|
+
if self.width is not None and self.width < 0:
|
|
73
|
+
raise ValueError("width must be greater than or equal to 0")
|
|
74
|
+
if self.thickness is not None and self.thickness < 0:
|
|
75
|
+
raise ValueError("thickness must be greater than or equal to 0")
|
|
76
|
+
if self.leading_indent is not None and self.leading_indent < 0:
|
|
77
|
+
raise ValueError("leading_indent must be greater than or equal to 0")
|
|
78
|
+
if self.trailing_indent is not None and self.trailing_indent < 0:
|
|
79
|
+
raise ValueError("trailing_indent must be greater than or equal to 0")
|
flet/controls/page.py
CHANGED
|
@@ -487,7 +487,8 @@ class Page(BasePage):
|
|
|
487
487
|
current page.
|
|
488
488
|
"""
|
|
489
489
|
_context_page.set(self)
|
|
490
|
-
|
|
490
|
+
if not asyncio.iscoroutinefunction(handler):
|
|
491
|
+
raise TypeError("handler must be a coroutine function")
|
|
491
492
|
|
|
492
493
|
future = asyncio.run_coroutine_threadsafe(
|
|
493
494
|
handler(*args, **kwargs), self.get_session().connection.loop
|
flet/testing/finder.py
CHANGED
flet/testing/flet_test_app.py
CHANGED
flet/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flet
|
|
3
|
-
Version: 0.70.0.
|
|
3
|
+
Version: 0.70.0.dev5776
|
|
4
4
|
Summary: Flet for Python - easily build interactive multi-platform apps in Python
|
|
5
5
|
Author-email: "Appveyor Systems Inc." <hello@flet.dev>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -9,10 +9,10 @@ Project-URL: Repository, https://github.com/flet-dev/flet
|
|
|
9
9
|
Project-URL: Documentation, https://docs.flet.dev/
|
|
10
10
|
Requires-Python: >=3.10
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
|
-
Requires-Dist: flet-cli==0.70.0.
|
|
13
|
-
Requires-Dist: flet-desktop==0.70.0.
|
|
14
|
-
Requires-Dist: flet-desktop-light==0.70.0.
|
|
15
|
-
Requires-Dist: flet-web==0.70.0.
|
|
12
|
+
Requires-Dist: flet-cli==0.70.0.dev5776; extra == "cli"
|
|
13
|
+
Requires-Dist: flet-desktop==0.70.0.dev5776; extra == "desktop" and (platform_system == "Darwin" or platform_system == "Windows")
|
|
14
|
+
Requires-Dist: flet-desktop-light==0.70.0.dev5776; platform_system == "Linux" and (extra == "all" or extra == "desktop")
|
|
15
|
+
Requires-Dist: flet-web==0.70.0.dev5776; extra == "web"
|
|
16
16
|
Requires-Dist: oauthlib>=3.2.2; platform_system != "Pyodide"
|
|
17
17
|
Requires-Dist: httpx>=0.28.1; platform_system != "Pyodide"
|
|
18
18
|
Requires-Dist: repath>=0.9.0
|