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
|
@@ -20,8 +20,7 @@ class CupertinoListTile(LayoutControl):
|
|
|
20
20
|
"""
|
|
21
21
|
An iOS-style list tile.
|
|
22
22
|
|
|
23
|
-
Can also serve as a cupertino equivalent of the
|
|
24
|
-
Material [`ListTile`][flet.ListTile].
|
|
23
|
+
Can also serve as a cupertino equivalent of the Material [`ListTile`][flet.].
|
|
25
24
|
|
|
26
25
|
Raises:
|
|
27
26
|
AssertionError: If [`title`][(c).] is neither a string nor a visible Control.
|
|
@@ -31,92 +30,81 @@ class CupertinoListTile(LayoutControl):
|
|
|
31
30
|
"""
|
|
32
31
|
The primary content of this list tile.
|
|
33
32
|
|
|
34
|
-
Typically a [`Text`][flet.
|
|
33
|
+
Typically a [`Text`][flet.] control.
|
|
35
34
|
"""
|
|
36
35
|
|
|
37
36
|
subtitle: Optional[StrOrControl] = None
|
|
38
37
|
"""
|
|
39
|
-
Additional content displayed below the [`title`][
|
|
38
|
+
Additional content displayed below the [`title`][(c).].
|
|
40
39
|
|
|
41
|
-
Typically a [`Text`][flet.
|
|
40
|
+
Typically a [`Text`][flet.] control.
|
|
42
41
|
"""
|
|
43
42
|
|
|
44
43
|
leading: Optional[IconDataOrControl] = None
|
|
45
44
|
"""
|
|
46
|
-
A control to display before the [`title`][
|
|
45
|
+
A control to display before the [`title`][(c).].
|
|
47
46
|
"""
|
|
48
47
|
|
|
49
48
|
trailing: Optional[IconDataOrControl] = None
|
|
50
49
|
"""
|
|
51
|
-
A control to display after the [`title`][
|
|
50
|
+
A control to display after the [`title`][(c).].
|
|
52
51
|
|
|
53
|
-
Typically an [`Icon`][flet.
|
|
52
|
+
Typically an [`Icon`][flet.] control.
|
|
54
53
|
"""
|
|
55
54
|
|
|
56
55
|
bgcolor: Optional[ColorValue] = None
|
|
57
56
|
"""
|
|
58
|
-
The list tile
|
|
57
|
+
The background color of this list tile.
|
|
59
58
|
"""
|
|
60
59
|
|
|
61
60
|
bgcolor_activated: Optional[ColorValue] = None
|
|
62
61
|
"""
|
|
63
|
-
The list tile
|
|
64
|
-
after the tile was tapped.
|
|
62
|
+
The background color of this list tile after it was tapped.
|
|
65
63
|
"""
|
|
66
64
|
|
|
67
65
|
padding: Optional[PaddingValue] = None
|
|
68
66
|
"""
|
|
69
|
-
The tile's internal padding. Insets a CupertinoListTile's contents:
|
|
70
|
-
[`leading`][
|
|
71
|
-
[`
|
|
72
|
-
|
|
73
|
-
[`additional_info`][flet.CupertinoListTile.additional_info]
|
|
74
|
-
and [`trailing`][flet.CupertinoListTile.trailing] controls.
|
|
75
|
-
""" # noqa: E501
|
|
67
|
+
The tile's internal padding. Insets a CupertinoListTile's contents:
|
|
68
|
+
its [`leading`][(c).], [`title`][(c).], [`subtitle`][(c).],
|
|
69
|
+
[`additional_info`][(c).] and [`trailing`][(c).] controls.
|
|
70
|
+
"""
|
|
76
71
|
|
|
77
72
|
url: Optional[Union[str, Url]] = None
|
|
78
73
|
"""
|
|
79
74
|
The URL to open when this button is clicked.
|
|
80
75
|
|
|
81
|
-
Additionally, if [`on_click`][
|
|
76
|
+
Additionally, if [`on_click`][(c).] event callback is
|
|
82
77
|
provided, it is fired after that.
|
|
83
78
|
"""
|
|
84
79
|
|
|
85
80
|
toggle_inputs: bool = False
|
|
86
81
|
"""
|
|
87
|
-
Whether clicking on
|
|
88
|
-
like [`Radio`][flet.
|
|
89
|
-
or [`Switch`][flet.Switch] inside the tile.
|
|
82
|
+
Whether clicking on this tile should toggle the state of (visible) toggleable
|
|
83
|
+
controls like [`Radio`][flet.], [`Checkbox`][flet.] or [`Switch`][flet.] inside it.
|
|
90
84
|
"""
|
|
91
85
|
|
|
92
86
|
additional_info: Optional[StrOrControl] = None
|
|
93
87
|
"""
|
|
94
|
-
A `Control` to display on the right of the list tile,
|
|
95
|
-
before [`trailing`][flet.CupertinoListTile.trailing].
|
|
88
|
+
A `Control` to display on the right of the list tile, before [`trailing`][(c).].
|
|
96
89
|
|
|
97
|
-
Similar to [`subtitle`][
|
|
98
|
-
|
|
99
|
-
display additional information.
|
|
90
|
+
Similar to [`subtitle`][(c).], an [`additional_info`][(c).]
|
|
91
|
+
is used to display additional information.
|
|
100
92
|
|
|
101
|
-
Typically a [`Text`][flet.
|
|
93
|
+
Typically a [`Text`][flet.] control.
|
|
102
94
|
"""
|
|
103
95
|
|
|
104
96
|
leading_size: Optional[Number] = None
|
|
105
97
|
"""
|
|
106
|
-
Used to constrain the width and height of
|
|
107
|
-
[`leading`][flet.CupertinoListTile.leading] control.
|
|
98
|
+
Used to constrain the width and height of [`leading`][(c).] control.
|
|
108
99
|
|
|
109
|
-
Defaults to `30.0`, if [`notched
|
|
110
|
-
else `28.0`.
|
|
100
|
+
Defaults to `30.0`, if [`notched`][(c).] is `True`, else `28.0`.
|
|
111
101
|
"""
|
|
112
102
|
|
|
113
103
|
leading_to_title: Optional[Number] = None
|
|
114
104
|
"""
|
|
115
|
-
The horizontal space between [`leading`][
|
|
116
|
-
and `[`title`][flet.CupertinoListTile.title].
|
|
105
|
+
The horizontal space between [`leading`][(c).] and `[`title`][(c).].
|
|
117
106
|
|
|
118
|
-
Defaults to `12.0`, if [`notched
|
|
119
|
-
else `16.0`.
|
|
107
|
+
Defaults to `12.0`, if [`notched`][(c).] is `True`, else `16.0`.
|
|
120
108
|
"""
|
|
121
109
|
|
|
122
110
|
notched: bool = False
|
|
@@ -24,8 +24,8 @@ class CupertinoNavigationBar(LayoutControl):
|
|
|
24
24
|
|
|
25
25
|
Raises:
|
|
26
26
|
AssertionError: If [`destinations`][(c).] does not contain at least two visible
|
|
27
|
-
[`NavigationBarDestination`][flet.
|
|
28
|
-
|
|
27
|
+
[`NavigationBarDestination`][flet.]s.
|
|
28
|
+
IndexError: If [`selected_index`][(c).] is out of range.
|
|
29
29
|
"""
|
|
30
30
|
|
|
31
31
|
destinations: list[NavigationBarDestination]
|
|
@@ -33,17 +33,17 @@ class CupertinoNavigationBar(LayoutControl):
|
|
|
33
33
|
The destinations of this navigation bar.
|
|
34
34
|
|
|
35
35
|
Note:
|
|
36
|
-
Must be a list of two or more [`NavigationBarDestination`][flet.
|
|
37
|
-
"""
|
|
36
|
+
Must be a list of two or more [`NavigationBarDestination`][flet.]s.
|
|
37
|
+
"""
|
|
38
38
|
|
|
39
39
|
selected_index: int = 0
|
|
40
40
|
"""
|
|
41
|
-
The index into [`destinations`][
|
|
42
|
-
currently selected [`NavigationBarDestination`][flet.
|
|
41
|
+
The index into [`destinations`][(c).] for the
|
|
42
|
+
currently selected [`NavigationBarDestination`][flet.].
|
|
43
43
|
|
|
44
44
|
Note:
|
|
45
45
|
Must be a value between `0` and the length of visible
|
|
46
|
-
[`destinations`][
|
|
46
|
+
[`destinations`][(c).], inclusive.
|
|
47
47
|
"""
|
|
48
48
|
|
|
49
49
|
bgcolor: Optional[ColorValue] = None
|
|
@@ -53,14 +53,13 @@ class CupertinoNavigationBar(LayoutControl):
|
|
|
53
53
|
|
|
54
54
|
active_color: Optional[ColorValue] = None
|
|
55
55
|
"""
|
|
56
|
-
The foreground color of the icon and
|
|
57
|
-
|
|
56
|
+
The foreground color of the icon and title of the
|
|
57
|
+
selected [`destination`][(c).destinations].
|
|
58
58
|
"""
|
|
59
59
|
|
|
60
60
|
inactive_color: ColorValue = CupertinoColors.INACTIVE_GRAY
|
|
61
61
|
"""
|
|
62
|
-
The foreground color of the icon and
|
|
63
|
-
title of the unselected destinations.
|
|
62
|
+
The foreground color of the icon and title of the unselected [`destinations`][(c).].
|
|
64
63
|
"""
|
|
65
64
|
|
|
66
65
|
border: Optional[Border] = None
|
|
@@ -31,23 +31,22 @@ class CupertinoPicker(LayoutControl):
|
|
|
31
31
|
|
|
32
32
|
item_extent: Number = 32.0
|
|
33
33
|
"""
|
|
34
|
-
The uniform height of all [`controls`][
|
|
34
|
+
The uniform height of all [`controls`][(c).].
|
|
35
35
|
"""
|
|
36
36
|
|
|
37
37
|
selected_index: int = 0
|
|
38
38
|
"""
|
|
39
|
-
The index (starting from `0`) of the selected item in
|
|
40
|
-
the [`controls`][flet.CupertinoPicker.controls] list.
|
|
39
|
+
The index (starting from `0`) of the selected item in the [`controls`][(c).] list.
|
|
41
40
|
"""
|
|
42
41
|
|
|
43
42
|
bgcolor: Optional[ColorValue] = None
|
|
44
43
|
"""
|
|
45
|
-
The background color of
|
|
44
|
+
The background color of this timer picker.
|
|
46
45
|
"""
|
|
47
46
|
|
|
48
47
|
use_magnifier: bool = False
|
|
49
48
|
"""
|
|
50
|
-
Whether to use the magnifier for the center item of
|
|
49
|
+
Whether to use the magnifier for the center item of this picker's wheel.
|
|
51
50
|
"""
|
|
52
51
|
|
|
53
52
|
looping: bool = False
|
|
@@ -57,11 +56,14 @@ class CupertinoPicker(LayoutControl):
|
|
|
57
56
|
|
|
58
57
|
magnification: Number = 1.0
|
|
59
58
|
"""
|
|
60
|
-
The zoomed-in rate of the magnifier
|
|
59
|
+
The zoomed-in or magnification rate of the magnifier.
|
|
61
60
|
|
|
62
61
|
If the value is greater than `1.0`, the item in the center will be zoomed in by that
|
|
63
62
|
rate, and it will also be rendered as flat, not cylindrical like the rest of the
|
|
64
63
|
list. The item will be zoomed-out if magnification is less than `1.0`.
|
|
64
|
+
|
|
65
|
+
Note:
|
|
66
|
+
Has effect only if [`use_magnifier`][(c).] is `True`.
|
|
65
67
|
"""
|
|
66
68
|
|
|
67
69
|
squeeze: Number = 1.45
|
|
@@ -87,13 +89,12 @@ class CupertinoPicker(LayoutControl):
|
|
|
87
89
|
matching the height of the center row.
|
|
88
90
|
|
|
89
91
|
Defaults to a rounded rectangle in iOS 14 style with
|
|
90
|
-
[`default_selection_overlay_bgcolor`][
|
|
91
|
-
"""
|
|
92
|
+
[`default_selection_overlay_bgcolor`][(c).] as background color.
|
|
93
|
+
"""
|
|
92
94
|
|
|
93
95
|
default_selection_overlay_bgcolor: ColorValue = CupertinoColors.TERTIARY_SYSTEM_FILL
|
|
94
96
|
"""
|
|
95
|
-
The default background color of the
|
|
96
|
-
[`selection_overlay`][flet.CupertinoPicker.selection_overlay].
|
|
97
|
+
The default background color of the [`selection_overlay`][(c).].
|
|
97
98
|
"""
|
|
98
99
|
|
|
99
100
|
on_change: Optional[ControlEventHandler["CupertinoPicker"]] = None
|
|
@@ -22,35 +22,33 @@ class CupertinoRadio(LayoutControl):
|
|
|
22
22
|
|
|
23
23
|
label: Optional[str] = None
|
|
24
24
|
"""
|
|
25
|
-
The clickable label to display on the right of
|
|
25
|
+
The clickable label to display on the right of this radio.
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
28
|
value: str = ""
|
|
29
29
|
"""
|
|
30
|
-
The value to set to [`RadioGroup`][flet.
|
|
30
|
+
The value to set to [`RadioGroup`][flet.] ancestor/parent when this radio
|
|
31
31
|
is selected.
|
|
32
32
|
"""
|
|
33
33
|
|
|
34
34
|
label_position: LabelPosition = LabelPosition.RIGHT
|
|
35
35
|
"""
|
|
36
|
-
The position of the label relative to
|
|
36
|
+
The position of the label relative to this radio.
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
39
|
fill_color: Optional[ColorValue] = None
|
|
40
40
|
"""
|
|
41
|
-
The color that fills
|
|
41
|
+
The color that fills this radio.
|
|
42
42
|
"""
|
|
43
43
|
|
|
44
44
|
active_color: Optional[ColorValue] = Colors.PRIMARY
|
|
45
45
|
"""
|
|
46
|
-
The color used to fill this radio
|
|
47
|
-
when it is selected.
|
|
46
|
+
The color used to fill this radio when it is selected.
|
|
48
47
|
"""
|
|
49
48
|
|
|
50
49
|
inactive_color: Optional[ColorValue] = None
|
|
51
50
|
"""
|
|
52
|
-
The color used to fill this radio
|
|
53
|
-
when it is not selected.
|
|
51
|
+
The color used to fill this radio when it is not selected.
|
|
54
52
|
"""
|
|
55
53
|
|
|
56
54
|
autofocus: bool = False
|
|
@@ -63,19 +61,18 @@ class CupertinoRadio(LayoutControl):
|
|
|
63
61
|
|
|
64
62
|
use_checkmark_style: bool = False
|
|
65
63
|
"""
|
|
66
|
-
Whether the radio displays in a checkbox style
|
|
64
|
+
Whether the radio displays in a checkbox style instead of the default radio style.
|
|
67
65
|
"""
|
|
68
66
|
|
|
69
67
|
toggleable: bool = False
|
|
70
68
|
"""
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
Whether this radio button can return to an indeterminate state
|
|
70
|
+
by selecting it again when already selected.
|
|
73
71
|
"""
|
|
74
72
|
|
|
75
73
|
focus_color: Optional[ColorValue] = None
|
|
76
74
|
"""
|
|
77
|
-
The color for the radio's border
|
|
78
|
-
when it has the input focus.
|
|
75
|
+
The color for the radio's border when it has the input focus.
|
|
79
76
|
"""
|
|
80
77
|
|
|
81
78
|
mouse_cursor: Optional[MouseCursor] = None
|
|
@@ -18,8 +18,7 @@ class CupertinoSegmentedButton(LayoutControl):
|
|
|
18
18
|
Raises:
|
|
19
19
|
AssertionError: If [`controls`][(c).] does not contain at least two visible
|
|
20
20
|
controls.
|
|
21
|
-
IndexError: If [`selected_index`][
|
|
22
|
-
is out of range.
|
|
21
|
+
IndexError: If [`selected_index`][(c).] is out of range.
|
|
23
22
|
"""
|
|
24
23
|
|
|
25
24
|
controls: list[Control]
|
|
@@ -33,29 +32,27 @@ class CupertinoSegmentedButton(LayoutControl):
|
|
|
33
32
|
selected_index: int = 0
|
|
34
33
|
"""
|
|
35
34
|
The index (starting from 0) of the selected segment in the
|
|
36
|
-
[`controls`][
|
|
35
|
+
[`controls`][(c).] list.
|
|
37
36
|
"""
|
|
38
37
|
|
|
39
38
|
selected_color: Optional[ColorValue] = None
|
|
40
39
|
"""
|
|
41
|
-
The color of
|
|
42
|
-
selected.
|
|
40
|
+
The color of this button when it is selected.
|
|
43
41
|
"""
|
|
44
42
|
|
|
45
43
|
unselected_color: Optional[ColorValue] = None
|
|
46
44
|
"""
|
|
47
|
-
The color of
|
|
48
|
-
selected.
|
|
45
|
+
The color of this button when it is not selected.
|
|
49
46
|
"""
|
|
50
47
|
|
|
51
48
|
border_color: Optional[ColorValue] = None
|
|
52
49
|
"""
|
|
53
|
-
The color of
|
|
50
|
+
The color of this button's border.
|
|
54
51
|
"""
|
|
55
52
|
|
|
56
53
|
padding: Optional[PaddingValue] = None
|
|
57
54
|
"""
|
|
58
|
-
|
|
55
|
+
This button's padding.
|
|
59
56
|
"""
|
|
60
57
|
|
|
61
58
|
click_color: Optional[ColorValue] = None
|
|
@@ -63,7 +60,7 @@ class CupertinoSegmentedButton(LayoutControl):
|
|
|
63
60
|
The color used to fill the background
|
|
64
61
|
of this control when temporarily interacting with through a long press or drag.
|
|
65
62
|
|
|
66
|
-
Defaults to the [`selected_color`][
|
|
63
|
+
Defaults to the [`selected_color`][(c).]
|
|
67
64
|
with 20% opacity.
|
|
68
65
|
"""
|
|
69
66
|
|
|
@@ -72,9 +69,9 @@ class CupertinoSegmentedButton(LayoutControl):
|
|
|
72
69
|
The color used to fill the background of the segment when it is disabled.
|
|
73
70
|
|
|
74
71
|
If `None`, this color will be 50% opacity of the
|
|
75
|
-
[`selected_color`][
|
|
72
|
+
[`selected_color`][(c).] when
|
|
76
73
|
the segment is selected. If the segment is unselected, this color will be
|
|
77
|
-
set to the [`unselected_color`][
|
|
74
|
+
set to the [`unselected_color`][(c).].
|
|
78
75
|
"""
|
|
79
76
|
|
|
80
77
|
disabled_text_color: Optional[ColorValue] = None
|
|
@@ -41,9 +41,8 @@ class CupertinoSlider(LayoutControl):
|
|
|
41
41
|
The minimum value the user can select.
|
|
42
42
|
|
|
43
43
|
Note:
|
|
44
|
-
- Must be less than or equal to [`max`][
|
|
45
|
-
- If the [`max`][
|
|
46
|
-
then the slider is disabled.
|
|
44
|
+
- Must be less than or equal to [`max`][(c).].
|
|
45
|
+
- If the [`max`][(c).] is equal to the `min`, then this slider is disabled.
|
|
47
46
|
"""
|
|
48
47
|
|
|
49
48
|
max: Number = 1.0
|
|
@@ -51,9 +50,8 @@ class CupertinoSlider(LayoutControl):
|
|
|
51
50
|
The maximum value the user can select.
|
|
52
51
|
|
|
53
52
|
Note:
|
|
54
|
-
- Must be greater than or equal to [`min`][
|
|
55
|
-
- If the [`min`][
|
|
56
|
-
then the slider is disabled.
|
|
53
|
+
- Must be greater than or equal to [`min`][(c).].
|
|
54
|
+
- If the [`min`][(c).] is equal to the `max`, then this slider is disabled.
|
|
57
55
|
"""
|
|
58
56
|
|
|
59
57
|
divisions: Optional[int] = None
|
|
@@ -65,8 +63,7 @@ class CupertinoSlider(LayoutControl):
|
|
|
65
63
|
|
|
66
64
|
active_color: Optional[ColorValue] = None
|
|
67
65
|
"""
|
|
68
|
-
The color to use for the portion of the
|
|
69
|
-
slider track that is active.
|
|
66
|
+
The color to use for the portion of the slider track that is active.
|
|
70
67
|
|
|
71
68
|
The "active" side of the slider is the side between the thumb and the minimum
|
|
72
69
|
value.
|
|
@@ -74,7 +71,7 @@ class CupertinoSlider(LayoutControl):
|
|
|
74
71
|
|
|
75
72
|
thumb_color: Optional[ColorValue] = None
|
|
76
73
|
"""
|
|
77
|
-
The color of
|
|
74
|
+
The color of this slider's thumb.
|
|
78
75
|
"""
|
|
79
76
|
|
|
80
77
|
on_change: Optional[ControlEventHandler["CupertinoSlider"]] = None
|
|
@@ -22,8 +22,8 @@ class CupertinoSlidingSegmentedButton(LayoutControl):
|
|
|
22
22
|
Raises:
|
|
23
23
|
AssertionError: If [`controls`][(c).] does not contain at least two
|
|
24
24
|
visible controls.
|
|
25
|
-
IndexError: If [`selected_index`][
|
|
26
|
-
"""
|
|
25
|
+
IndexError: If [`selected_index`][(c).] is out of range.
|
|
26
|
+
"""
|
|
27
27
|
|
|
28
28
|
controls: list[Control]
|
|
29
29
|
"""
|
|
@@ -35,47 +35,44 @@ class CupertinoSlidingSegmentedButton(LayoutControl):
|
|
|
35
35
|
|
|
36
36
|
selected_index: int = 0
|
|
37
37
|
"""
|
|
38
|
-
The index (starting from 0) of the selected segment in the `controls` list.
|
|
38
|
+
The index (starting from 0) of the selected segment in the [`controls`][(c).] list.
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
41
|
bgcolor: ColorValue = CupertinoColors.TERTIARY_SYSTEM_FILL
|
|
42
42
|
"""
|
|
43
|
-
The background color of
|
|
43
|
+
The background color of this button.
|
|
44
44
|
"""
|
|
45
45
|
|
|
46
46
|
thumb_color: Optional[ColorValue] = None
|
|
47
47
|
"""
|
|
48
|
-
The color of
|
|
49
|
-
selected.
|
|
48
|
+
The color of this button when it is not selected.
|
|
50
49
|
"""
|
|
51
50
|
|
|
52
51
|
padding: PaddingValue = field(
|
|
53
52
|
default_factory=lambda: Padding.symmetric(vertical=2, horizontal=3)
|
|
54
53
|
)
|
|
55
54
|
"""
|
|
56
|
-
The amount of space by which to inset the
|
|
57
|
-
[`controls`][flet.CupertinoSlidingSegmentedButton.controls].
|
|
55
|
+
The amount of space by which to inset the [`controls`][(c).].
|
|
58
56
|
"""
|
|
59
57
|
|
|
60
58
|
proportional_width: bool = False
|
|
61
59
|
"""
|
|
62
60
|
Determine whether segments have proportional widths based on their content.
|
|
63
61
|
|
|
64
|
-
If
|
|
65
|
-
segment. If
|
|
62
|
+
If `False`, all segments will have the same width, determined by the longest
|
|
63
|
+
segment. If `True`, each segment's width will be determined by its individual
|
|
66
64
|
content.
|
|
67
65
|
|
|
68
|
-
If the max width of parent constraints is smaller than the width that
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
the
|
|
72
|
-
up to meet the min width requirement.
|
|
66
|
+
If the max width of parent constraints is smaller than the width that this control
|
|
67
|
+
needs, the segment widths will scale down proportionally to ensure this control
|
|
68
|
+
fits within the boundaries; similarly, if the min width of parent constraints is
|
|
69
|
+
larger, the segment width will scales up to meet the min width requirement.
|
|
73
70
|
"""
|
|
74
71
|
|
|
75
72
|
on_change: Optional[ControlEventHandler["CupertinoSlidingSegmentedButton"]] = None
|
|
76
73
|
"""
|
|
77
|
-
Called when the state of the button is changed -
|
|
78
|
-
clicked.
|
|
74
|
+
Called when the state of the button is changed -
|
|
75
|
+
when one of the [`controls`][(c).] is clicked.
|
|
79
76
|
"""
|
|
80
77
|
|
|
81
78
|
def before_update(self):
|
|
@@ -17,7 +17,9 @@ __all__ = ["CupertinoSwitch"]
|
|
|
17
17
|
@control("CupertinoSwitch")
|
|
18
18
|
class CupertinoSwitch(LayoutControl):
|
|
19
19
|
"""
|
|
20
|
-
An iOS-style switch.
|
|
20
|
+
An iOS-style switch.
|
|
21
|
+
|
|
22
|
+
Used to toggle the on/off state of a single setting.
|
|
21
23
|
"""
|
|
22
24
|
|
|
23
25
|
label: Optional[str] = None
|
|
@@ -32,7 +34,7 @@ class CupertinoSwitch(LayoutControl):
|
|
|
32
34
|
|
|
33
35
|
label_position: LabelPosition = LabelPosition.RIGHT
|
|
34
36
|
"""
|
|
35
|
-
The position of the label relative to
|
|
37
|
+
The position of the [`label`][(c).] relative to this switch.
|
|
36
38
|
"""
|
|
37
39
|
|
|
38
40
|
thumb_color: Optional[ColorValue] = None
|
|
@@ -42,8 +44,7 @@ class CupertinoSwitch(LayoutControl):
|
|
|
42
44
|
|
|
43
45
|
focus_color: Optional[ColorValue] = None
|
|
44
46
|
"""
|
|
45
|
-
The color to use for the focus highlight
|
|
46
|
-
for keyboard interactions.
|
|
47
|
+
The color to use for the focus highlight for keyboard interactions.
|
|
47
48
|
"""
|
|
48
49
|
|
|
49
50
|
autofocus: bool = False
|
|
@@ -56,14 +57,12 @@ class CupertinoSwitch(LayoutControl):
|
|
|
56
57
|
|
|
57
58
|
on_label_color: Optional[ColorValue] = None
|
|
58
59
|
"""
|
|
59
|
-
The color to use for the accessibility
|
|
60
|
-
label when the switch is on.
|
|
60
|
+
The color to use for the accessibility label when the switch is on.
|
|
61
61
|
"""
|
|
62
62
|
|
|
63
63
|
off_label_color: Optional[ColorValue] = None
|
|
64
64
|
"""
|
|
65
|
-
The color to use for the accessibility
|
|
66
|
-
label when the switch is off.
|
|
65
|
+
The color to use for the accessibility label when the switch is off.
|
|
67
66
|
"""
|
|
68
67
|
|
|
69
68
|
active_thumb_image: Optional[str] = None
|
|
@@ -82,79 +81,69 @@ class CupertinoSwitch(LayoutControl):
|
|
|
82
81
|
|
|
83
82
|
active_track_color: Optional[ColorValue] = None
|
|
84
83
|
"""
|
|
85
|
-
The color to use on the track when this
|
|
86
|
-
switch is on.
|
|
84
|
+
The color to use on the track when this switch is on.
|
|
87
85
|
"""
|
|
88
86
|
|
|
89
87
|
inactive_thumb_color: Optional[ColorValue] = None
|
|
90
88
|
"""
|
|
91
|
-
The color to use on the thumb when this
|
|
92
|
-
switch is off.
|
|
89
|
+
The color to use on the thumb when this switch is off.
|
|
93
90
|
|
|
94
|
-
If `None`, defaults to [`thumb_color`][
|
|
95
|
-
|
|
96
|
-
[`CupertinoColors.WHITE`][flet.CupertinoColors.WHITE].
|
|
91
|
+
If `None`, defaults to [`thumb_color`][(c).], and if this is also `None`,
|
|
92
|
+
defaults to [`CupertinoColors.WHITE`][flet.].
|
|
97
93
|
"""
|
|
98
94
|
|
|
99
95
|
inactive_track_color: Optional[ColorValue] = None
|
|
100
96
|
"""
|
|
101
|
-
The color to use on the track when this
|
|
102
|
-
switch is off.
|
|
97
|
+
The color to use on the track when this switch is off.
|
|
103
98
|
"""
|
|
104
99
|
|
|
105
100
|
track_outline_color: Optional[ControlStateValue[ColorValue]] = None
|
|
106
101
|
"""
|
|
107
102
|
The outline color of this switch's track
|
|
108
|
-
in various [`ControlState`][flet.
|
|
103
|
+
in various [`ControlState`][flet.]s.
|
|
109
104
|
|
|
110
|
-
Supported states: [`ControlState.SELECTED`][flet.
|
|
111
|
-
[`ControlState.HOVERED`][flet.ControlState.
|
|
112
|
-
[`ControlState.
|
|
113
|
-
[`ControlState.FOCUSED`][flet.ControlState.FOCUSED],
|
|
114
|
-
and [`ControlState.DEFAULT`][flet.ControlState.DEFAULT].
|
|
105
|
+
Supported states: [`ControlState.SELECTED`][flet.],
|
|
106
|
+
[`ControlState.HOVERED`][flet.], [`ControlState.DISABLED`][flet.],
|
|
107
|
+
[`ControlState.FOCUSED`][flet.], and [`ControlState.DEFAULT`][flet.].
|
|
115
108
|
"""
|
|
116
109
|
|
|
117
110
|
track_outline_width: Optional[ControlStateValue[Optional[Number]]] = None
|
|
118
111
|
"""
|
|
119
112
|
The outline width of this switch's track in all or specific
|
|
120
|
-
[`ControlState`][flet.
|
|
113
|
+
[`ControlState`][flet.]s.
|
|
121
114
|
|
|
122
|
-
Supported states: [`ControlState.SELECTED`][flet.
|
|
123
|
-
[`ControlState.HOVERED`][flet.ControlState.
|
|
124
|
-
[`ControlState.
|
|
125
|
-
[`ControlState.FOCUSED`][flet.ControlState.FOCUSED],
|
|
126
|
-
and [`ControlState.DEFAULT`][flet.ControlState.DEFAULT].
|
|
115
|
+
Supported states: [`ControlState.SELECTED`][flet.],
|
|
116
|
+
[`ControlState.HOVERED`][flet.], [`ControlState.DISABLED`][flet.],
|
|
117
|
+
[`ControlState.FOCUSED`][flet.], and [`ControlState.DEFAULT`][flet.].
|
|
127
118
|
"""
|
|
128
119
|
|
|
129
120
|
thumb_icon: Optional[ControlStateValue[IconData]] = None
|
|
130
121
|
"""
|
|
131
122
|
The icon of this Switch's thumb in various
|
|
132
|
-
[`ControlState`][flet.
|
|
123
|
+
[`ControlState`][flet.]s.
|
|
133
124
|
|
|
134
|
-
Supported states: [`ControlState.SELECTED`][flet.
|
|
135
|
-
[`ControlState.HOVERED`][flet.ControlState.
|
|
136
|
-
[`ControlState.
|
|
137
|
-
[`ControlState.FOCUSED`][flet.ControlState.FOCUSED],
|
|
138
|
-
and [`ControlState.DEFAULT`][flet.ControlState.DEFAULT].
|
|
125
|
+
Supported states: [`ControlState.SELECTED`][flet.],
|
|
126
|
+
[`ControlState.HOVERED`][flet.], [`ControlState.DISABLED`][flet.],
|
|
127
|
+
[`ControlState.FOCUSED`][flet.], and [`ControlState.DEFAULT`][flet.].
|
|
139
128
|
"""
|
|
140
129
|
|
|
141
130
|
on_change: Optional[ControlEventHandler["CupertinoSwitch"]] = None
|
|
142
131
|
"""
|
|
143
|
-
Called when the state of
|
|
132
|
+
Called when the state of this switch is changed.
|
|
144
133
|
"""
|
|
145
134
|
|
|
146
135
|
on_focus: Optional[ControlEventHandler["CupertinoSwitch"]] = None
|
|
147
136
|
"""
|
|
148
|
-
Called when
|
|
137
|
+
Called when this switch has received focus.
|
|
149
138
|
"""
|
|
150
139
|
|
|
151
140
|
on_blur: Optional[ControlEventHandler["CupertinoSwitch"]] = None
|
|
152
141
|
"""
|
|
153
|
-
Called when
|
|
142
|
+
Called when this switch has lost focus.
|
|
154
143
|
"""
|
|
155
144
|
|
|
156
145
|
on_image_error: Optional[ControlEventHandler["CupertinoSwitch"]] = None
|
|
157
146
|
"""
|
|
158
|
-
Called when
|
|
159
|
-
[`inactive_thumb_image`][
|
|
160
|
-
"""
|
|
147
|
+
Called when [`active_thumb_image`][(c).] or
|
|
148
|
+
[`inactive_thumb_image`][(c).] fails to load.
|
|
149
|
+
"""
|