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.

Files changed (125) hide show
  1. flet/__init__.py +2 -0
  2. flet/controls/adaptive_control.py +16 -13
  3. flet/controls/base_page.py +5 -5
  4. flet/controls/border.py +4 -3
  5. flet/controls/box.py +6 -11
  6. flet/controls/buttons.py +7 -7
  7. flet/controls/context.py +2 -2
  8. flet/controls/control.py +18 -11
  9. flet/controls/core/animated_switcher.py +9 -13
  10. flet/controls/core/canvas/canvas.py +1 -1
  11. flet/controls/core/canvas/line.py +2 -3
  12. flet/controls/core/canvas/oval.py +1 -1
  13. flet/controls/core/canvas/shape.py +10 -10
  14. flet/controls/core/canvas/text.py +1 -1
  15. flet/controls/core/column.py +5 -5
  16. flet/controls/core/dismissible.py +8 -8
  17. flet/controls/core/drag_target.py +5 -4
  18. flet/controls/core/draggable.py +19 -14
  19. flet/controls/core/grid_view.py +2 -2
  20. flet/controls/core/image.py +1 -1
  21. flet/controls/core/interactive_viewer.py +2 -2
  22. flet/controls/core/list_view.py +7 -7
  23. flet/controls/core/markdown.py +1 -1
  24. flet/controls/core/pagelet.py +10 -10
  25. flet/controls/core/reorderable_draggable.py +1 -1
  26. flet/controls/core/responsive_row.py +7 -7
  27. flet/controls/core/row.py +8 -8
  28. flet/controls/core/semantics.py +9 -6
  29. flet/controls/core/shader_mask.py +3 -3
  30. flet/controls/core/stack.py +4 -4
  31. flet/controls/core/text.py +7 -7
  32. flet/controls/core/text_span.py +4 -4
  33. flet/controls/core/transparent_pointer.py +3 -3
  34. flet/controls/core/view.py +16 -16
  35. flet/controls/core/window.py +1 -1
  36. flet/controls/core/window_drag_area.py +1 -1
  37. flet/controls/cupertino/cupertino_action_sheet.py +19 -8
  38. flet/controls/cupertino/cupertino_activity_indicator.py +5 -6
  39. flet/controls/cupertino/cupertino_alert_dialog.py +7 -10
  40. flet/controls/cupertino/cupertino_app_bar.py +34 -34
  41. flet/controls/cupertino/cupertino_bottom_sheet.py +5 -5
  42. flet/controls/cupertino/cupertino_button.py +4 -4
  43. flet/controls/cupertino/cupertino_checkbox.py +33 -40
  44. flet/controls/cupertino/cupertino_context_menu.py +7 -6
  45. flet/controls/cupertino/cupertino_context_menu_action.py +2 -4
  46. flet/controls/cupertino/cupertino_date_picker.py +35 -37
  47. flet/controls/cupertino/cupertino_dialog_action.py +12 -9
  48. flet/controls/cupertino/cupertino_list_tile.py +24 -36
  49. flet/controls/cupertino/cupertino_navigation_bar.py +10 -11
  50. flet/controls/cupertino/cupertino_picker.py +11 -10
  51. flet/controls/cupertino/cupertino_radio.py +10 -13
  52. flet/controls/cupertino/cupertino_segmented_button.py +9 -12
  53. flet/controls/cupertino/cupertino_slider.py +6 -9
  54. flet/controls/cupertino/cupertino_sliding_segmented_button.py +14 -17
  55. flet/controls/cupertino/cupertino_switch.py +30 -41
  56. flet/controls/cupertino/cupertino_textfield.py +14 -18
  57. flet/controls/cupertino/cupertino_timer_picker.py +11 -8
  58. flet/controls/exceptions.py +5 -5
  59. flet/controls/icon_data.py +2 -2
  60. flet/controls/keys.py +2 -1
  61. flet/controls/layout_control.py +22 -27
  62. flet/controls/material/alert_dialog.py +44 -50
  63. flet/controls/material/app_bar.py +41 -45
  64. flet/controls/material/auto_complete.py +10 -8
  65. flet/controls/material/badge.py +32 -28
  66. flet/controls/material/banner.py +14 -14
  67. flet/controls/material/bottom_app_bar.py +7 -9
  68. flet/controls/material/bottom_sheet.py +10 -10
  69. flet/controls/material/button.py +2 -24
  70. flet/controls/material/card.py +10 -11
  71. flet/controls/material/checkbox.py +41 -49
  72. flet/controls/material/chip.py +44 -47
  73. flet/controls/material/circle_avatar.py +19 -22
  74. flet/controls/material/container.py +16 -123
  75. flet/controls/material/datatable.py +71 -95
  76. flet/controls/material/date_picker.py +13 -14
  77. flet/controls/material/date_range_picker.py +183 -0
  78. flet/controls/material/divider.py +24 -23
  79. flet/controls/material/dropdown.py +13 -13
  80. flet/controls/material/expansion_tile.py +5 -6
  81. flet/controls/material/filled_button.py +1 -1
  82. flet/controls/material/floating_action_button.py +2 -2
  83. flet/controls/material/form_field_control.py +64 -56
  84. flet/controls/material/icon_button.py +29 -65
  85. flet/controls/material/list_tile.py +25 -23
  86. flet/controls/material/menu_item_button.py +2 -2
  87. flet/controls/material/navigation_bar.py +3 -3
  88. flet/controls/material/navigation_rail.py +11 -11
  89. flet/controls/material/outlined_button.py +1 -1
  90. flet/controls/material/popup_menu_button.py +3 -3
  91. flet/controls/material/progress_bar.py +15 -22
  92. flet/controls/material/progress_ring.py +8 -8
  93. flet/controls/material/radio.py +3 -8
  94. flet/controls/material/range_slider.py +1 -1
  95. flet/controls/material/search_bar.py +15 -16
  96. flet/controls/material/segmented_button.py +4 -4
  97. flet/controls/material/selection_area.py +4 -3
  98. flet/controls/material/slider.py +16 -16
  99. flet/controls/material/snack_bar.py +33 -32
  100. flet/controls/material/submenu_button.py +9 -9
  101. flet/controls/material/switch.py +13 -13
  102. flet/controls/material/tabs.py +77 -78
  103. flet/controls/material/text_button.py +2 -2
  104. flet/controls/material/textfield.py +4 -6
  105. flet/controls/material/tooltip.py +16 -15
  106. flet/controls/material/vertical_divider.py +10 -10
  107. flet/controls/page.py +4 -4
  108. flet/controls/painting.py +2 -2
  109. flet/controls/scrollable_control.py +1 -1
  110. flet/controls/services/file_picker.py +7 -7
  111. flet/controls/services/haptic_feedback.py +1 -1
  112. flet/controls/services/shake_detector.py +1 -1
  113. flet/controls/services/storage_paths.py +3 -3
  114. flet/controls/text_style.py +1 -1
  115. flet/controls/theme.py +611 -609
  116. flet/controls/types.py +11 -11
  117. flet/testing/finder.py +2 -0
  118. flet/testing/flet_test_app.py +6 -4
  119. flet/version.py +1 -1
  120. {flet-0.70.0.dev5623.dist-info → flet-0.70.0.dev5774.dist-info}/METADATA +5 -5
  121. flet-0.70.0.dev5774.dist-info/RECORD +239 -0
  122. flet-0.70.0.dev5623.dist-info/RECORD +0 -238
  123. {flet-0.70.0.dev5623.dist-info → flet-0.70.0.dev5774.dist-info}/WHEEL +0 -0
  124. {flet-0.70.0.dev5623.dist-info → flet-0.70.0.dev5774.dist-info}/entry_points.txt +0 -0
  125. {flet-0.70.0.dev5623.dist-info → flet-0.70.0.dev5774.dist-info}/top_level.txt +0 -0
@@ -66,7 +66,7 @@ class NavigationRailDestination(Control):
66
66
  indicator_color: Optional[ColorValue] = None
67
67
  """
68
68
  The color of the
69
- [`indicator_shape`][flet.NavigationRailDestination.indicator_shape] when
69
+ [`indicator_shape`][(c).] when
70
70
  this destination is selected.
71
71
  """
72
72
 
@@ -153,7 +153,7 @@ class NavigationRail(LayoutControl):
153
153
 
154
154
  Its location is not affected by `group_alignment`.
155
155
 
156
- Typically a [`FloatingActionButton`][flet.FloatingActionButton], but
156
+ Typically a [`FloatingActionButton`][flet.], but
157
157
  may also be a non-button, such as a logo.
158
158
  """
159
159
 
@@ -204,7 +204,7 @@ class NavigationRail(LayoutControl):
204
204
 
205
205
  selected_label_text_style: Optional[TextStyle] = None
206
206
  """
207
- The [`TextStyle`][flet.TextStyle] of a
207
+ The [`TextStyle`][flet.] of a
208
208
  destination's label when it is selected.
209
209
 
210
210
  When a destination is not selected, `unselected_label_text_style` will instead be
@@ -213,7 +213,7 @@ class NavigationRail(LayoutControl):
213
213
 
214
214
  unselected_label_text_style: Optional[TextStyle] = None
215
215
  """
216
- The [`TextStyle`][flet.TextStyle] of a
216
+ The [`TextStyle`][flet.] of a
217
217
  destination's label when it is not selected.
218
218
 
219
219
  When a destination is selected, `selected_label_text_style` will instead be used.
@@ -223,15 +223,15 @@ class NavigationRail(LayoutControl):
223
223
  """
224
224
  Whether to add a rounded navigation indicator behind the selected destination's icon.
225
225
 
226
- The indicator's shape will be circular if [`label_type`][flet.NavigationRail.label_type]
227
- is [`NavigationRailLabelType.NONE`][flet.NavigationRailLabelType.NONE], or a
228
- [`StadiumBorder`][flet.StadiumBorder] if [`label_type`][flet.NavigationRail.label_type]
229
- is [`NavigationRailLabelType.ALL`][flet.NavigationRailLabelType.ALL] or
230
- [`NavigationRailLabelType.SELECTED`][flet.NavigationRailLabelType.SELECTED].
226
+ The indicator's shape will be circular if [`label_type`][(c).]
227
+ is [`NavigationRailLabelType.NONE`][flet.], or a
228
+ [`StadiumBorder`][flet.] if [`label_type`][(c).]
229
+ is [`NavigationRailLabelType.ALL`][flet.] or
230
+ [`NavigationRailLabelType.SELECTED`][flet.].
231
231
 
232
232
  If `None`, defaults to
233
- [`NavigationRailTheme.use_indicator`][flet.NavigationRailTheme.use_indicator].
234
- If that is also `None`, defaults to [`Theme.use_material3`][flet.Theme.use_material3].
233
+ [`NavigationRailTheme.use_indicator`][flet.].
234
+ If that is also `None`, defaults to [`Theme.use_material3`][flet.].
235
235
  """ # noqa: E501
236
236
 
237
237
  on_change: Optional[ControlEventHandler["NavigationRail"]] = None
@@ -61,7 +61,7 @@ class OutlinedButton(LayoutControl, AdaptiveControl):
61
61
  """
62
62
  The URL to open when this button is clicked.
63
63
 
64
- Additionally, if [`on_click`][flet.OutlinedButton.on_click] event callback is
64
+ Additionally, if [`on_click`][(c).] event callback is
65
65
  provided, it is fired after that.
66
66
  """
67
67
 
@@ -43,7 +43,7 @@ class PopupMenuItem(Control):
43
43
  Whether this menu item is checked.
44
44
 
45
45
  If set to `True`, a checkmark will be shown on the left of the
46
- [`content`][flet.PopupMenuItem.content].
46
+ [`content`][(c).].
47
47
  """
48
48
 
49
49
  height: Number = 48.0
@@ -58,11 +58,11 @@ class PopupMenuItem(Control):
58
58
  Defaults to `Padding.symmetric(horizontal=12)`.
59
59
 
60
60
  Note:
61
- The [`height`][flet.PopupMenuItem.height] value of this menu item may
61
+ The [`height`][(c).] value of this menu item may
62
62
  influence the applied padding.
63
63
 
64
64
  For example, if a `height` greater than the height of the sum of the padding
65
- and a [`content`][flet.PopupMenuItem.content] is provided, then the padding's
65
+ and a [`content`][(c).] is provided, then the padding's
66
66
  effect will not be visible.
67
67
  """
68
68
 
@@ -64,28 +64,23 @@ class ProgressBar(LayoutControl):
64
64
  """
65
65
  The color of the stop indicator.
66
66
 
67
- If [`ProgressBar.year2023`][flet.ProgressBar.year_2023] is `True` or
68
- [`Theme.use_material3`][flet.Theme.use_material3] is `False`, then no stop
69
- indicator will be drawn.
67
+ If [`ProgressBar.year_2023`][flet.] is `True` or [`Theme.use_material3`][flet.]
68
+ is `False`, then no stop indicator will be drawn.
70
69
 
71
- If not set, then the
72
- [`ProgressIndicatorTheme.stop_indicator_color`][flet.ProgressIndicatorTheme.stop_indicator_color]
73
- will be used. If that is not set, then the
74
- [`ColorScheme.primary`][flet.ColorScheme.primary] will be used.
70
+ If not set, then the [`ProgressIndicatorTheme.stop_indicator_color`][flet.] will
71
+ be used. If that is not set, then the [`ColorScheme.primary`][flet.] will be used.
75
72
  """
76
73
 
77
74
  stop_indicator_radius: Optional[Number] = None
78
75
  """
79
76
  The radius of the stop indicator.
80
77
 
81
- If [`ProgressBar.year2023`][flet.ProgressBar.year_2023] is `True` or
82
- [`Theme.use_material3`][flet.Theme.use_material3] is `False`, then no stop
83
- indicator will be drawn.
78
+ If [`ProgressBar.year_2023`][flet.] is `True` or [`Theme.use_material3`][flet.] is
79
+ `False`, then no stop indicator will be drawn.
84
80
 
85
81
  Set `stop_indicator_radius` to `0` to hide the stop indicator.
86
82
 
87
- If not set, then the
88
- [`ProgressIndicatorTheme.stop_indicator_radius`][flet.ProgressIndicatorTheme.stop_indicator_radius]
83
+ If not set, then the [`ProgressIndicatorTheme.stop_indicator_radius`][flet.]
89
84
  will be used. If that is not set, then defaults to `2`.
90
85
  """
91
86
 
@@ -93,15 +88,15 @@ class ProgressBar(LayoutControl):
93
88
  """
94
89
  The gap between the indicator and the track.
95
90
 
96
- If [`ProgressBar.year2023`][flet.ProgressBar.year_2023] is `True` or
97
- [`Theme.use_material3`][flet.Theme.use_material3] is `False`, then no track gap
91
+ If [`ProgressBar.year_2023`][flet.] is `True` or
92
+ [`Theme.use_material3`][flet.] is `False`, then no track gap
98
93
  will be drawn.
99
94
 
100
- Set `track_gap` to `0` to hide the track gap.
101
-
102
- If not set, then the
103
- [`ProgressIndicatorTheme.track_gap`][flet.ProgressIndicatorTheme.track_gap] will be
95
+ If not set, then the [`ProgressIndicatorTheme.track_gap`][flet.] will be
104
96
  used. If that is not set, then defaults to `4`.
97
+
98
+ Tip:
99
+ Set `track_gap` to `0` to hide the track gap.
105
100
  """
106
101
 
107
102
  year_2023: Optional[bool] = None
@@ -111,12 +106,10 @@ class ProgressBar(LayoutControl):
111
106
 
112
107
  When `True`, the ProgressBar will use the 2023 Material Design 3 appearance.
113
108
 
114
- If not set, then the
115
- [`ProgressIndicatorTheme.year_2023`][flet.ProgressIndicatorTheme.year_2023] will be
109
+ If not set, then the [`ProgressIndicatorTheme.year_2023`][flet.] will be
116
110
  used, which is `False` by default.
117
111
 
118
- If [`Theme.use_material3`][flet.Theme.use_material3] is `False`, then this property
119
- is ignored.
112
+ If [`Theme.use_material3`][flet.] is `False`, then this property is ignored.
120
113
  """
121
114
 
122
115
  def before_update(self):
@@ -53,7 +53,7 @@ class ProgressRing(LayoutControl):
53
53
 
54
54
  A value of 0 (center stroke) will center the border on the edge of the control.
55
55
 
56
- If [`ProgressRing.year_2023`][flet.ProgressRing.year_2023] is `True`, then the
56
+ If [`ProgressRing.year_2023`][flet.] is `True`, then the
57
57
  default value is `0`. Otherwise, the default value is `-1`.
58
58
  """
59
59
 
@@ -77,13 +77,13 @@ class ProgressRing(LayoutControl):
77
77
  """
78
78
  The gap between the active indicator and the background track.
79
79
 
80
- If [`year_2023`][flet.ProgressRing.year_2023] is `True` or `Theme.use_material3` is
80
+ If [`year_2023`][(c).] is `True` or `Theme.use_material3` is
81
81
  `False`, then no track gap will be drawn.
82
82
 
83
83
  Set `track_gap` to `0` to hide this track gap.
84
84
 
85
85
  If `None`,
86
- [`ProgressIndicatorTheme.track_gap`][flet.ProgressIndicatorTheme.track_gap] is used.
86
+ [`ProgressIndicatorTheme.track_gap`][flet.] is used.
87
87
 
88
88
  If that's is also `None`, defaults to `4.0`.
89
89
  """
@@ -93,7 +93,7 @@ class ProgressRing(LayoutControl):
93
93
  Defines the minimum and maximum size of the progress indicator.
94
94
 
95
95
  If `None`,
96
- [`ProgressIndicatorTheme.size_constraints`][flet.ProgressIndicatorTheme.size_constraints]
96
+ [`ProgressIndicatorTheme.size_constraints`][flet.]
97
97
  is used.
98
98
 
99
99
  If that's is also `None`, defaults to a minimum width and height of `36`.
@@ -104,10 +104,10 @@ class ProgressRing(LayoutControl):
104
104
  The padding around the indicator track.
105
105
 
106
106
  If `None`,
107
- [`ProgressIndicatorTheme.circular_track_padding`][flet.ProgressIndicatorTheme.circular_track_padding]
107
+ [`ProgressIndicatorTheme.circular_track_padding`][flet.]
108
108
  is used.
109
109
 
110
- If that's is also `None` and [`year_2023`][flet.ProgressRing.year_2023] is `False`,
110
+ If that's is also `None` and [`year_2023`][(c).] is `False`,
111
111
  defaults to `Padding.all(4.0)`.
112
112
 
113
113
  Otherwise, defaults to `Padding.all(0.0)`.
@@ -121,9 +121,9 @@ class ProgressRing(LayoutControl):
121
121
  When `True`, the `ProgressRing` will use the 2023 Material Design 3 appearance.
122
122
 
123
123
  If not set, then the
124
- [`ProgressIndicatorTheme.year_2023`][flet.ProgressIndicatorTheme.year_2023] will be
124
+ [`ProgressIndicatorTheme.year_2023`][flet.] will be
125
125
  used, which is `False` by default.
126
126
 
127
- If [`Theme.use_material3`][flet.Theme.use_material3] is `False`, then this property
127
+ If [`Theme.use_material3`][flet.] is `False`, then this property
128
128
  is ignored.
129
129
  """
@@ -53,22 +53,17 @@ class Radio(LayoutControl, AdaptiveControl):
53
53
 
54
54
  fill_color: Optional[ControlStateValue[ColorValue]] = None
55
55
  """
56
- The color that fills the radio, in all or
57
- specific [`ControlState`][flet.ControlState]
58
- states.
56
+ The color that fills the radio, in all or specific [`ControlState`][flet.] states.
59
57
  """
60
58
 
61
59
  active_color: Optional[ColorValue] = None
62
60
  """
63
- The color used to fill this radio when it
64
- is selected.
61
+ The color used to fill this radio when it is selected.
65
62
  """
66
63
 
67
64
  overlay_color: Optional[ControlStateValue[ColorValue]] = None
68
65
  """
69
- The overlay color of this radio in all or
70
- specific [`ControlState`][flet.ControlState]
71
- states.
66
+ The overlay color of this radio in all or specific [`ControlState`][flet.] states.
72
67
  """
73
68
 
74
69
  hover_color: Optional[ColorValue] = None
@@ -100,7 +100,7 @@ class RangeSlider(LayoutControl):
100
100
  """
101
101
  The highlight color that's typically
102
102
  used to indicate that the range slider thumb is in `HOVERED` or `DRAGGED`
103
- [`ControlState`][flet.ControlState] .
103
+ [`ControlState`][flet.] .
104
104
  """
105
105
 
106
106
  mouse_cursor: Optional[ControlStateValue[MouseCursor]] = None
@@ -30,8 +30,8 @@ class SearchBar(LayoutControl):
30
30
  controls: list[Control] = field(default_factory=list)
31
31
  """
32
32
  The list of controls to be displayed below the search bar when in search view.
33
- These controls are usually [`ListTile`][flet.ListTile]s and will be displayed
34
- in a [`ListView`][flet.ListView].
33
+ These controls are usually [`ListTile`][flet.]s and will be displayed
34
+ in a [`ListView`][flet.].
35
35
  """
36
36
 
37
37
  value: str = ""
@@ -57,23 +57,22 @@ class SearchBar(LayoutControl):
57
57
  bar_hint_text: Optional[str] = None
58
58
  """
59
59
  Defines the text to be shown in the search bar when it is empty and the search
60
- view is close. Usually some text that suggests what sort of input the field
61
- accepts.
60
+ view is close.
61
+
62
+ Usually some text that suggests what sort of input the field accepts.
62
63
  """
63
64
 
64
65
  bar_bgcolor: Optional[ControlStateValue[ColorValue]] = None
65
66
  """
66
- Defines the background color of the
67
- search bar in all or specific
68
- [`ControlState`][flet.ControlState] states.
67
+ Defines the background color of the search bar in all or specific
68
+ [`ControlState`][flet.] states.
69
69
  """
70
70
 
71
71
  bar_overlay_color: Optional[ControlStateValue[ColorValue]] = None
72
72
  """
73
- Defines the highlight color that's
74
- typically used to indicate that the search bar is in `FOCUSED`, `HOVERED`, or
75
- `PRESSED` [`ControlState`][flet.ControlState]
76
- states.
73
+ Defines the highlight color that's typically used to indicate that the
74
+ search bar is in [`FOCUSED`][flet.ControlState.], [`HOVERED`][flet.ControlState.],
75
+ or [`PRESSED`][flet.ControlState.] states.
77
76
  """
78
77
 
79
78
  bar_shadow_color: Optional[ControlStateValue[ColorValue]] = None
@@ -90,7 +89,7 @@ class SearchBar(LayoutControl):
90
89
  """
91
90
  The color and weight of the search bar's outline.
92
91
 
93
- This value is combined with [`SearchBar.bar_shape`][flet.SearchBar.bar_shape] to
92
+ This value is combined with [`SearchBar.bar_shape`][flet.] to
94
93
  create a shape decorated with an outline.
95
94
  """
96
95
 
@@ -99,7 +98,7 @@ class SearchBar(LayoutControl):
99
98
  The shape of the search bar.
100
99
 
101
100
  This shape is combined with
102
- [`SearchBar.bar_border_side`][flet.SearchBar.bar_border_side] to create a shape
101
+ [`SearchBar.bar_border_side`][flet.] to create a shape
103
102
  decorated with an outline.
104
103
  """
105
104
 
@@ -110,7 +109,7 @@ class SearchBar(LayoutControl):
110
109
 
111
110
  bar_hint_text_style: Optional[ControlStateValue[TextStyle]] = None
112
111
  """
113
- The style to use for the [`SearchBar.bar_hint_text`][flet.SearchBar.bar_hint_text].
112
+ The style to use for the [`SearchBar.bar_hint_text`][flet.].
114
113
  """
115
114
 
116
115
  bar_padding: Optional[ControlStateValue[PaddingValue]] = None
@@ -176,13 +175,13 @@ class SearchBar(LayoutControl):
176
175
 
177
176
  view_header_text_style: Optional[TextStyle] = None
178
177
  """
179
- Defines the [`TextStyle`][flet.TextStyle] of the
178
+ Defines the [`TextStyle`][flet.] of the
180
179
  text being edited on the search view.
181
180
  """
182
181
 
183
182
  view_hint_text_style: Optional[TextStyle] = None
184
183
  """
185
- Defines the [`TextStyle`][flet.TextStyle] of
184
+ Defines the [`TextStyle`][flet.] of
186
185
  `view_hint_text`.
187
186
  """
188
187
 
@@ -20,7 +20,7 @@ __all__ = ["Segment", "SegmentedButton"]
20
20
  @control("Segment")
21
21
  class Segment(Control):
22
22
  """
23
- A segment for a [`SegmentedButton`][flet.SegmentedButton].
23
+ A segment for a [`SegmentedButton`][flet.].
24
24
 
25
25
  Raises:
26
26
  AssertionError: If neither [`icon`][(c).] nor [`label`][(c).] is set.
@@ -33,13 +33,13 @@ class Segment(Control):
33
33
 
34
34
  icon: Optional[IconDataOrControl] = None
35
35
  """
36
- The icon (typically an [`Icon`][flet.Icon]) to be
36
+ The icon (typically an [`Icon`][flet.]) to be
37
37
  displayed in the segment.
38
38
  """
39
39
 
40
40
  label: Optional[StrOrControl] = None
41
41
  """
42
- The label (usually a [`Text`][flet.Text]) to be
42
+ The label (usually a [`Text`][flet.]) to be
43
43
  displayed in the segment.
44
44
  """
45
45
 
@@ -147,7 +147,7 @@ class SegmentedButton(LayoutControl):
147
147
  """
148
148
  Called when the selection changes.
149
149
 
150
- The [`data`][flet.Event.data] property of the event handler argument
150
+ The [`data`][flet.Event.] property of the event handler argument
151
151
  contains a list of strings identifying the selected segments.
152
152
  """
153
153
 
@@ -20,9 +20,10 @@ class SelectionArea(Control):
20
20
  content: Control
21
21
  """
22
22
  The child control this selection area applies to.
23
-
24
- If you need to have multiple selectable controls, use container-like controls
25
- like [`Row`][flet.Row] or [`Column`][flet.Column], which have a `controls` property for this purpose.
23
+
24
+ If you need to have multiple selectable controls, use container-like controls
25
+ like [`Row`][flet.] or [`Column`][flet.], which have a `controls` property
26
+ for this purpose.
26
27
  """
27
28
 
28
29
  on_change: Optional[ControlEventHandler["SelectionArea"]] = None
@@ -36,7 +36,7 @@ class Slider(LayoutControl, AdaptiveControl):
36
36
  Raises:
37
37
  AssertionError: If [`min`][(c).] is greater than or equal to [`max`][(c).].
38
38
  AssertionError: If [`min`][(c).] is greater than or equal to [`value`][(c).].
39
- AssertionError: If [`max`][(c).] is less than or equal to [`value`][(c)].
39
+ AssertionError: If [`max`][(c).] is less than or equal to [`value`][(c).].
40
40
  """
41
41
 
42
42
  value: Optional[Number] = None
@@ -45,7 +45,7 @@ class Slider(LayoutControl, AdaptiveControl):
45
45
 
46
46
  The slider's thumb is drawn at a position that corresponds to this value.
47
47
 
48
- Defaults to value of [`min`][flet.Slider.min].
48
+ Defaults to value of [`min`][(c).].
49
49
  """
50
50
 
51
51
  label: Optional[str] = None
@@ -65,8 +65,8 @@ class Slider(LayoutControl, AdaptiveControl):
65
65
  The minimum value the user can select.
66
66
 
67
67
  Note:
68
- - Must be less than or equal to [`max`][flet.Slider.max].
69
- - If the [`max`][flet.Slider.max] is equal to the `min`, then this slider
68
+ - Must be less than or equal to [`max`][(c).].
69
+ - If the [`max`][(c).] is equal to the `min`, then this slider
70
70
  is disabled.
71
71
  """
72
72
 
@@ -75,8 +75,8 @@ class Slider(LayoutControl, AdaptiveControl):
75
75
  The maximum value the user can select.
76
76
 
77
77
  Note:
78
- - Must be greater than or equal to [`min`][flet.Slider.min].
79
- - If the [`min`][flet.Slider.min] is equal to the `max`, then this slider
78
+ - Must be greater than or equal to [`min`][(c).].
79
+ - If the [`min`][(c).] is equal to the `max`, then this slider
80
80
  is disabled.
81
81
  """
82
82
 
@@ -84,15 +84,15 @@ class Slider(LayoutControl, AdaptiveControl):
84
84
  """
85
85
  The number of discrete divisions.
86
86
 
87
- Typically used with [`label`][flet.Slider.label] to show the current discrete value.
87
+ Typically used with [`label`][(c).] to show the current discrete value.
88
88
 
89
89
  If `None`, this slider is continuous.
90
90
  """
91
91
 
92
92
  round: int = 0
93
93
  """
94
- The number of decimals displayed on the [`label`][flet.Slider.label]
95
- containing [`value`][flet.Slider.value].
94
+ The number of decimals displayed on the [`label`][(c).]
95
+ containing [`value`][(c).].
96
96
 
97
97
  Defaults to `0`, which displays value rounded to the nearest integer.
98
98
  """
@@ -131,24 +131,24 @@ class Slider(LayoutControl, AdaptiveControl):
131
131
  """
132
132
  The allowed way for the user to interact with this slider.
133
133
 
134
- If `None`, [`SliderTheme.interaction`][flet.SliderTheme.interaction] is used.
134
+ If `None`, [`SliderTheme.interaction`][flet.] is used.
135
135
  If that's is also `None`, defaults to
136
- [`SliderInteraction.TAP_AND_SLIDE`][flet.SliderInteraction.TAP_AND_SLIDE].
136
+ [`SliderInteraction.TAP_AND_SLIDE`][flet.].
137
137
  """
138
138
 
139
139
  secondary_active_color: Optional[ColorValue] = None
140
140
  """
141
141
  The color to use for the portion of
142
142
  the slider track between the thumb and
143
- the [`secondary_track_value`][flet.Slider.secondary_track_value].
143
+ the [`secondary_track_value`][(c).].
144
144
  """
145
145
 
146
146
  overlay_color: Optional[ControlStateValue[ColorValue]] = None
147
147
  """
148
148
  The highlight color that's typically
149
149
  used to indicate that the range slider thumb is in
150
- [`ControlState.HOVERED`][flet.ControlState.HOVERED] or
151
- [`ControlState.DRAGGED`][flet.ControlState.DRAGGED] states.
150
+ [`ControlState.HOVERED`][flet.] or
151
+ [`ControlState.DRAGGED`][flet.] states.
152
152
  """
153
153
 
154
154
  secondary_track_value: Optional[Number] = None
@@ -182,10 +182,10 @@ class Slider(LayoutControl, AdaptiveControl):
182
182
  When `True`, the Slider will use the 2023 Material Design 3 appearance.
183
183
 
184
184
  If not set, then the
185
- [`SliderTheme.year_2023`][flet.SliderTheme.year_2023] will be
185
+ [`SliderTheme.year_2023`][flet.] will be
186
186
  used, which is `False` by default.
187
187
 
188
- If [`Theme.use_material3`][flet.Theme.use_material3] is `False`,
188
+ If [`Theme.use_material3`][flet.] is `False`,
189
189
  then this property is ignored.
190
190
  """
191
191
 
@@ -17,7 +17,7 @@ from flet.controls.types import (
17
17
  StrOrControl,
18
18
  )
19
19
 
20
- __all__ = ["SnackBar", "SnackBarBehavior", "DismissDirection", "SnackBarAction"]
20
+ __all__ = ["DismissDirection", "SnackBar", "SnackBarAction", "SnackBarBehavior"]
21
21
 
22
22
 
23
23
  class SnackBarBehavior(Enum):
@@ -38,14 +38,15 @@ class DismissDirection(Enum):
38
38
  @control("SnackBar")
39
39
  class SnackBarAction(Control):
40
40
  """
41
- A button that can be used as an action in a [`SnackBar`][flet.SnackBar].
41
+ A button that can be used as an action in a [`SnackBar`][flet.].
42
42
 
43
- An action button for a [`SnackBar`][flet.SnackBar].
43
+ An action button for a [`SnackBar`][flet.].
44
44
 
45
45
  Note:
46
46
  - Snack bar actions are always enabled. Instead of disabling a snack bar
47
47
  action, avoid including it in the snack bar in the first place.
48
- - Snack bar actions can will only respond to first click. Subsequent clicks/presses are ignored.
48
+ - Snack bar actions can will only respond to first click.
49
+ Subsequent clicks/presses are ignored.
49
50
  """
50
51
 
51
52
  label: str
@@ -56,8 +57,8 @@ class SnackBarAction(Control):
56
57
  text_color: Optional[ColorValue] = None
57
58
  """
58
59
  The button label color.
59
-
60
- If `None`, [`SnackBarTheme.action_text_color`][flet.SnackBarTheme.action_text_color] is used.
60
+
61
+ If `None`, [`SnackBarTheme.action_text_color`][flet.] is used.
61
62
  """
62
63
 
63
64
  disabled_text_color: Optional[ColorValue] = None
@@ -69,8 +70,8 @@ class SnackBarAction(Control):
69
70
  bgcolor: Optional[ColorValue] = None
70
71
  """
71
72
  The button background fill color.
72
-
73
- If `None`, [`SnackBarTheme.action_bgcolor`][flet.SnackBarTheme.action_bgcolor] is used.
73
+
74
+ If `None`, [`SnackBarTheme.action_bgcolor`][flet.] is used.
74
75
  """
75
76
 
76
77
  disabled_bgcolor: Optional[ColorValue] = None
@@ -78,7 +79,7 @@ class SnackBarAction(Control):
78
79
  The button disabled background color.
79
80
  This color is shown after the action is dismissed.
80
81
 
81
- If `None`, [`SnackBarTheme.disabled_action_bgcolor`][flet.SnackBarTheme.disabled_action_bgcolor] is used.
82
+ If `None`, [`SnackBarTheme.disabled_action_bgcolor`][flet.] is used.
82
83
  """
83
84
 
84
85
  on_click: Optional[ControlEventHandler["SnackBarAction"]] = None
@@ -98,7 +99,7 @@ class SnackBar(DialogControl):
98
99
  """
99
100
  The primary content of the snack bar.
100
101
 
101
- Typically a [`Text`][flet.Text] control.
102
+ Typically a [`Text`][flet.] control.
102
103
  """
103
104
 
104
105
  behavior: Optional[SnackBarBehavior] = None
@@ -106,26 +107,26 @@ class SnackBar(DialogControl):
106
107
  This defines the behavior and location of the snack bar.
107
108
 
108
109
  Defines where a SnackBar should appear within a page and how its location
109
- should be adjusted when the page also includes a [`FloatingActionButton`][flet.FloatingActionButton] or a
110
- [`NavigationBar`][flet.NavigationBar].
110
+ should be adjusted when the page also includes a [`FloatingActionButton`][flet.]
111
+ or a [`NavigationBar`][flet.].
111
112
 
112
- If `None`, [`SnackBarTheme.behavior`][flet.SnackBarTheme.behavior] is used.
113
- If that's is also `None`, defaults to [`SnackBarBehavior.FIXED`][flet.SnackBarBehavior.FIXED].
113
+ If `None`, [`SnackBarTheme.behavior`][flet.] is used.
114
+ If that's is also `None`, defaults to [`SnackBarBehavior.FIXED`][flet.].
114
115
 
115
116
  Note:
116
- - If [`behavior`][flet.SnackBar.behavior] is [`SnackBarBehavior.FLOATING`][flet.SnackBarBehavior.FLOATING],
117
- the length of the bar is defined by either [`width`][flet.SnackBar.width] and
118
- [`margin`][flet.SnackBar.margin], and if both are specified, `width` takes precedence over `margin`.
119
- - [`width`][flet.SnackBar.width] and [`margin`][flet.SnackBar.margin]
120
- are ignored if `behavior!=SnackBarBehavior.FLOATING`.
117
+ - If [`behavior`][(c).] is [`SnackBarBehavior.FLOATING`][flet.], the length of
118
+ the bar is defined by either [`width`][(c).] and [`margin`][(c).], and if
119
+ both are specified, `width` takes precedence over `margin`.
120
+ - [`width`][(c).] and [`margin`][(c).] are ignored if [`behavior`][(c).]
121
+ is not [`SnackBarBehavior.FLOATING`][flet.].
121
122
  """
122
123
 
123
124
  dismiss_direction: Optional[DismissDirection] = None
124
125
  """
125
126
  The direction in which the SnackBar can be dismissed.
126
127
 
127
- If `None`, [`SnackBarTheme.dismiss_direction`][flet.SnackBarTheme.dismiss_direction] is used.
128
- If that's is also `None`, defaults to [`DismissDirection.DOWN`][flet.DismissDirection.DOWN].
128
+ If `None`, [`SnackBarTheme.dismiss_direction`][flet.] is used.
129
+ If that's is also `None`, defaults to [`DismissDirection.DOWN`][flet.].
129
130
  """
130
131
 
131
132
  show_close_icon: bool = False
@@ -147,7 +148,7 @@ class SnackBar(DialogControl):
147
148
 
148
149
  close_icon_color: Optional[ColorValue] = None
149
150
  """
150
- The color of the close icon, if [`show_close_icon`][flet.SnackBar.show_close_icon] is `True`.
151
+ The color of the close icon, if [`show_close_icon`][(c).] is `True`.
151
152
  """
152
153
 
153
154
  bgcolor: Optional[ColorValue] = None
@@ -181,7 +182,7 @@ class SnackBar(DialogControl):
181
182
  available space.
182
183
 
183
184
  Note:
184
- Has effect only when [`behavior`][flet.SnackBar.behavior] is [`SnackBarBehavior.FLOATING`][flet.SnackBarBehavior.FLOATING].
185
+ Has effect only when [`behavior`][(c).] is [`SnackBarBehavior.FLOATING`][flet.].
185
186
  It can not be used if `margin` is specified.
186
187
  """
187
188
 
@@ -198,20 +199,20 @@ class SnackBar(DialogControl):
198
199
 
199
200
  clip_behavior: ClipBehavior = ClipBehavior.HARD_EDGE
200
201
  """
201
- The [`content`][flet.SnackBar.content] will be clipped (or not) according to this option.
202
+ The [`content`][(c).] will be clipped (or not) according to this option.
202
203
  """
203
204
 
204
205
  action_overflow_threshold: Number = 0.25
205
206
  """
206
- The percentage threshold for [`action`][flet.SnackBar.action]'s width before
207
+ The percentage threshold for [`action`][(c).]'s width before
207
208
  it overflows to a new line.
208
209
 
209
- If the width of the snackbar's [`content`][flet.SnackBar.content] is greater than this percentage of the
210
- width of the snackbar minus the width of its `action`, then the `action` will
211
- appear below the `content`.
210
+ If the width of the snackbar's [`content`][(c).] is greater than this percentage
211
+ of the width of the snackbar minus the width of its `action`, then the `action`
212
+ will appear below the [`content`][(c).].
212
213
 
213
214
  At a value of `0.0`, the `action` will not overflow to a new line.
214
-
215
+
215
216
  Note:
216
217
  Must be between `0.0` and `1.0` inclusive.
217
218
  """
@@ -235,6 +236,6 @@ class SnackBar(DialogControl):
235
236
  self.action_overflow_threshold is None
236
237
  or 0 <= self.action_overflow_threshold <= 1
237
238
  ), "action_overflow_threshold must be between 0 and 1 inclusive"
238
- assert (
239
- self.elevation is None or self.elevation >= 0
240
- ), "elevation cannot be negative"
239
+ assert self.elevation is None or self.elevation >= 0, (
240
+ "elevation cannot be negative"
241
+ )