flet 0.70.0.dev6214__py3-none-any.whl → 0.70.0.dev6268__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of flet might be problematic. Click here for more details.

Files changed (80) hide show
  1. flet/controls/base_control.py +1 -1
  2. flet/controls/border.py +3 -3
  3. flet/controls/control.py +6 -4
  4. flet/controls/core/animated_switcher.py +3 -3
  5. flet/controls/core/autofill_group.py +5 -3
  6. flet/controls/core/column.py +15 -2
  7. flet/controls/core/dismissible.py +9 -5
  8. flet/controls/core/drag_target.py +5 -3
  9. flet/controls/core/draggable.py +6 -4
  10. flet/controls/core/grid_view.py +22 -0
  11. flet/controls/core/icon.py +12 -4
  12. flet/controls/core/image.py +9 -0
  13. flet/controls/core/interactive_viewer.py +16 -8
  14. flet/controls/core/pagelet.py +3 -3
  15. flet/controls/core/reorderable_draggable.py +5 -3
  16. flet/controls/core/safe_area.py +5 -3
  17. flet/controls/core/text.py +4 -0
  18. flet/controls/core/text_span.py +3 -3
  19. flet/controls/core/window_drag_area.py +3 -3
  20. flet/controls/cupertino/cupertino_action_sheet.py +4 -4
  21. flet/controls/cupertino/cupertino_action_sheet_action.py +3 -3
  22. flet/controls/cupertino/cupertino_activity_indicator.py +3 -3
  23. flet/controls/cupertino/cupertino_button.py +7 -3
  24. flet/controls/cupertino/cupertino_checkbox.py +11 -0
  25. flet/controls/cupertino/cupertino_context_menu.py +6 -4
  26. flet/controls/cupertino/cupertino_context_menu_action.py +3 -3
  27. flet/controls/cupertino/cupertino_date_picker.py +26 -9
  28. flet/controls/cupertino/cupertino_dialog_action.py +3 -3
  29. flet/controls/cupertino/cupertino_filled_button.py +4 -0
  30. flet/controls/cupertino/cupertino_list_tile.py +14 -3
  31. flet/controls/cupertino/cupertino_navigation_bar.py +8 -5
  32. flet/controls/cupertino/cupertino_picker.py +9 -4
  33. flet/controls/cupertino/cupertino_radio.py +14 -0
  34. flet/controls/cupertino/cupertino_segmented_button.py +18 -4
  35. flet/controls/cupertino/cupertino_slider.py +13 -4
  36. flet/controls/cupertino/cupertino_sliding_segmented_button.py +18 -4
  37. flet/controls/cupertino/cupertino_switch.py +4 -0
  38. flet/controls/cupertino/cupertino_textfield.py +4 -0
  39. flet/controls/cupertino/cupertino_timer_picker.py +16 -13
  40. flet/controls/cupertino/cupertino_tinted_button.py +4 -0
  41. flet/controls/material/alert_dialog.py +4 -4
  42. flet/controls/material/app_bar.py +10 -6
  43. flet/controls/material/banner.py +10 -6
  44. flet/controls/material/bottom_app_bar.py +3 -3
  45. flet/controls/material/bottom_sheet.py +3 -3
  46. flet/controls/material/card.py +15 -0
  47. flet/controls/material/checkbox.py +6 -0
  48. flet/controls/material/chip.py +16 -5
  49. flet/controls/material/circle_avatar.py +19 -5
  50. flet/controls/material/datatable.py +56 -19
  51. flet/controls/material/divider.py +23 -5
  52. flet/controls/material/dropdown.py +14 -3
  53. flet/controls/material/dropdownm2.py +11 -0
  54. flet/controls/material/expansion_panel.py +34 -0
  55. flet/controls/material/expansion_tile.py +15 -2
  56. flet/controls/material/filled_button.py +4 -0
  57. flet/controls/material/filled_tonal_button.py +4 -0
  58. flet/controls/material/floating_action_button.py +22 -7
  59. flet/controls/material/icon_button.py +14 -2
  60. flet/controls/material/list_tile.py +11 -0
  61. flet/controls/material/navigation_rail.py +9 -5
  62. flet/controls/material/outlined_button.py +3 -3
  63. flet/controls/material/progress_bar.py +9 -5
  64. flet/controls/material/radio_group.py +3 -3
  65. flet/controls/material/range_slider.py +15 -6
  66. flet/controls/material/segmented_button.py +20 -11
  67. flet/controls/material/selection_area.py +3 -3
  68. flet/controls/material/slider.py +10 -5
  69. flet/controls/material/snack_bar.py +9 -5
  70. flet/controls/material/switch.py +3 -3
  71. flet/controls/material/tabs.py +18 -14
  72. flet/controls/material/textfield.py +14 -5
  73. flet/controls/material/vertical_divider.py +12 -6
  74. flet/testing/flet_test_app.py +1 -0
  75. flet/version.py +1 -1
  76. {flet-0.70.0.dev6214.dist-info → flet-0.70.0.dev6268.dist-info}/METADATA +1 -1
  77. {flet-0.70.0.dev6214.dist-info → flet-0.70.0.dev6268.dist-info}/RECORD +80 -80
  78. {flet-0.70.0.dev6214.dist-info → flet-0.70.0.dev6268.dist-info}/WHEEL +0 -0
  79. {flet-0.70.0.dev6214.dist-info → flet-0.70.0.dev6268.dist-info}/entry_points.txt +0 -0
  80. {flet-0.70.0.dev6214.dist-info → flet-0.70.0.dev6268.dist-info}/top_level.txt +0 -0
@@ -27,11 +27,12 @@ class Chip(LayoutControl):
27
27
  """
28
28
  Chips are compact elements that represent an attribute, text, entity, or action.
29
29
 
30
- Raises:
31
- ValueError: If [`elevation`][(c).] or [`elevation_on_click`][(c).] is
32
- negative.
33
- ValueError: If callback for both [`on_click`][(c).] and [`on_select`][(c).]
34
- are specified.
30
+ ```python
31
+ ft.Chip(
32
+ label="Explore topics",
33
+ leading=ft.Icon(ft.Icons.EXPLORE_OUTLINED),
34
+ )
35
+ ```
35
36
  """
36
37
 
37
38
  label: StrOrControl
@@ -64,6 +65,9 @@ class Chip(LayoutControl):
64
65
  A non-negative value which defines the size of the shadow below this chip.
65
66
 
66
67
  Defaults to `0`.
68
+
69
+ Raises:
70
+ ValueError: If [`elevation`][(c).] is negative.
67
71
  """
68
72
 
69
73
  bgcolor: Optional[ColorValue] = None
@@ -166,6 +170,9 @@ class Chip(LayoutControl):
166
170
 
167
171
  Note:
168
172
  Must be non-negative.
173
+
174
+ Raises:
175
+ ValueError: If [`elevation_on_click`][(c).] is negative.
169
176
  """
170
177
 
171
178
  clip_behavior: ClipBehavior = ClipBehavior.NONE
@@ -225,6 +232,10 @@ class Chip(LayoutControl):
225
232
 
226
233
  Note:
227
234
  Cannot be specified together with [`on_select`][(c).].
235
+
236
+ Raises:
237
+ ValueError: If both [`on_click`][(c).] and [`on_select`][(c).] callbacks
238
+ are provided.
228
239
  """
229
240
 
230
241
  on_delete: Optional[ControlEventHandler["Chip"]] = None
@@ -20,11 +20,13 @@ class CircleAvatar(LayoutControl):
20
20
  If [`foreground_image_src`][(c).] fails then [`background_image_src`][(c).] is used,
21
21
  and if this also fails, then [`bgcolor`][(c).] is used.
22
22
 
23
- Raises:
24
- ValueError: If [`radius`][(c).] or [`min_radius`][(c).]
25
- or [`max_radius`][(c).] is negative.
26
- ValueError: If [`radius`][(c).] is set and [`min_radius`][(c).]
27
- or [`max_radius`][(c).] is not None.
23
+ ```python
24
+ ft.CircleAvatar(
25
+ content=ft.Text("AB"),
26
+ bgcolor=ft.Colors.PRIMARY,
27
+ color=ft.Colors.ON_PRIMARY,
28
+ )
29
+ ```
28
30
  """
29
31
 
30
32
  content: Optional[StrOrControl] = None
@@ -75,6 +77,11 @@ class CircleAvatar(LayoutControl):
75
77
  The size of the avatar, expressed as the radius (half the diameter). If `radius` is
76
78
  specified, then neither [`min_radius`][(c).] nor
77
79
  [`max_radius`][(c).] may be specified.
80
+
81
+ Raises:
82
+ ValueError: If [`radius`][(c).] is negative.
83
+ ValueError: If [`radius`][(c).] is set while [`min_radius`][(c).]
84
+ or [`max_radius`][(c).] is provided.
78
85
  """
79
86
 
80
87
  min_radius: Optional[Number] = None
@@ -83,6 +90,9 @@ class CircleAvatar(LayoutControl):
83
90
  `min_radius` is specified, then [`radius`][(c).] should not be specified.
84
91
 
85
92
  Defaults to `0.0`.
93
+
94
+ Raises:
95
+ ValueError: If [`min_radius`][(c).] is negative.
86
96
  """
87
97
 
88
98
  max_radius: Optional[Number] = None
@@ -93,6 +103,10 @@ class CircleAvatar(LayoutControl):
93
103
 
94
104
  Note:
95
105
  If `max_radius` is specified, then [`radius`][(c).] should not be specified.
106
+
107
+ Raises:
108
+ ValueError: If [`max_radius`][(c).] is negative.
109
+ ValueError: If [`max_radius`][(c).] is provided while [`radius`][(c).] is set.
96
110
  """
97
111
 
98
112
  on_image_error: Optional[ControlEventHandler["CircleAvatar"]] = None
@@ -34,10 +34,6 @@ class DataColumnSortEvent(Event["DataColumn"]):
34
34
  class DataColumn(Control):
35
35
  """
36
36
  Column configuration for a [`DataTable`][flet.].
37
-
38
- Raises:
39
- ValueError: If the [`label`][(c).] is neither a string nor
40
- a visible control.
41
37
  """
42
38
 
43
39
  label: StrOrControl
@@ -47,6 +43,10 @@ class DataColumn(Control):
47
43
  Typically, this will be a [`Text`][flet.] control.
48
44
  It could also be an [`Icon`][flet.] (typically using size 18),
49
45
  or a combination of both in a [`Row`][flet.].
46
+
47
+ Raises:
48
+ ValueError: If the [`label`][(c).] is neither a string nor
49
+ a visible control.
50
50
  """
51
51
 
52
52
  numeric: bool = False
@@ -93,10 +93,6 @@ class DataColumn(Control):
93
93
  class DataCell(Control):
94
94
  """
95
95
  The data for a cell of a [`DataTable`][flet.].
96
-
97
- Raises:
98
- ValueError: If the [`content`][(c).] is neither a string nor a visible
99
- control.
100
96
  """
101
97
 
102
98
  content: StrOrControl
@@ -113,6 +109,10 @@ class DataCell(Control):
113
109
  To lay out multiple children, set the [`content`][(c).] to a
114
110
  container-like control such as [`Row`][flet.], [`Column`][flet.], or
115
111
  [`Stack`][flet.], which have a `controls` property.
112
+
113
+ Raises:
114
+ ValueError: If the [`content`][(c).] is neither a string nor a visible
115
+ control.
116
116
  """
117
117
 
118
118
  placeholder: bool = False
@@ -199,9 +199,6 @@ class DataRow(Control):
199
199
  One row configuration must be provided for each row to display in the table.
200
200
 
201
201
  The data for this row of the table is provided in the [`cells`][(c).] property.
202
-
203
- Raises:
204
- ValueError: If [`cells`][(c).] does not contain at least one visible DataCell.
205
202
  """
206
203
 
207
204
  cells: list[DataCell] = field(default_factory=list)
@@ -210,6 +207,10 @@ class DataRow(Control):
210
207
 
211
208
  Note:
212
209
  There must be exactly as many cells as there are columns in the table.
210
+
211
+ Raises:
212
+ ValueError: If [`cells`][(c).] does not contain at least one visible
213
+ [`DataCell`][flet.].
213
214
  """
214
215
 
215
216
  color: Optional[ControlStateValue[ColorValue]] = None
@@ -281,24 +282,45 @@ class DataTable(LayoutControl):
281
282
  """
282
283
  A Material Design data table.
283
284
 
284
- Raises:
285
- ValueError: If there are no visible [`columns`][(c).].
286
- ValueError: If any visible row does not contain exactly as many visible
287
- [`DataRow.cells`][flet.] as there are visible [`columns`][(c).].
288
- ValueError: If [`data_row_min_height`][(c).] is greater than
289
- [`data_row_max_height`][(c).].
290
- ValueError: If [`divider_thickness`][(c).] is negative.
291
- ValueError: If [`sort_column_index`][(c).] is out of range.
285
+ ```python
286
+ ft.DataTable(
287
+ columns=[
288
+ ft.DataColumn(label=ft.Text("Name")),
289
+ ft.DataColumn(label=ft.Text("Role")),
290
+ ],
291
+ rows=[
292
+ ft.DataRow(
293
+ cells=[
294
+ ft.DataCell(ft.Text("Alice")),
295
+ ft.DataCell(ft.Text("Engineer")),
296
+ ]
297
+ ),
298
+ ft.DataRow(
299
+ cells=[
300
+ ft.DataCell(ft.Text("Bob")),
301
+ ft.DataCell(ft.Text("Designer")),
302
+ ]
303
+ ),
304
+ ],
305
+ )
306
+ ```
292
307
  """
293
308
 
294
309
  columns: list[DataColumn]
295
310
  """
296
311
  A list of [`DataColumn`][flet.] controls describing table columns.
312
+
313
+ Raises:
314
+ ValueError: If there are no visible [`columns`][(c).].
297
315
  """
298
316
 
299
317
  rows: list[DataRow] = field(default_factory=list)
300
318
  """
301
319
  A list of [`DataRow`][flet.] controls defining table rows.
320
+
321
+ Raises:
322
+ ValueError: If any visible row does not contain exactly as many visible
323
+ [`DataCell`][flet.]s as there are visible [`columns`][(c).].
302
324
  """
303
325
 
304
326
  sort_ascending: bool = False
@@ -336,6 +358,10 @@ class DataTable(LayoutControl):
336
358
 
337
359
  When this is `None`, it implies that the table's sort order does not correspond to
338
360
  any of the columns.
361
+
362
+ Raises:
363
+ ValueError: If [`sort_column_index`][(c).] is out of range relative to the
364
+ visible [`columns`][(c).].
339
365
  """
340
366
 
341
367
  show_bottom_border: bool = False
@@ -397,6 +423,10 @@ class DataTable(LayoutControl):
397
423
 
398
424
  Note:
399
425
  Must be less than or equal to [`data_row_max_height`][(c).].
426
+
427
+ Raises:
428
+ ValueError: If [`data_row_min_height`][(c).] is greater than
429
+ [`data_row_max_height`][(c).].
400
430
  """
401
431
 
402
432
  data_row_max_height: Optional[Number] = None
@@ -409,6 +439,10 @@ class DataTable(LayoutControl):
409
439
 
410
440
  Note:
411
441
  Must be greater than or equal to [`data_row_min_height`][(c).].
442
+
443
+ Raises:
444
+ ValueError: If [`data_row_max_height`][(c).] is less than
445
+ [`data_row_min_height`][(c).].
412
446
  """
413
447
 
414
448
  data_text_style: Optional[TextStyle] = None
@@ -432,6 +466,9 @@ class DataTable(LayoutControl):
432
466
 
433
467
  Note:
434
468
  Must be greater than or equal to zero.
469
+
470
+ Raises:
471
+ ValueError: If [`divider_thickness`][(c).] is negative.
435
472
  """
436
473
 
437
474
  heading_row_color: Optional[ControlStateValue[ColorValue]] = None
@@ -13,11 +13,17 @@ class Divider(Control):
13
13
  """
14
14
  A thin horizontal line (divider), with padding on either side.
15
15
 
16
- Raises:
17
- ValueError: If [`height`][(c).] is negative.
18
- ValueError: If [`thickness`][(c).] is negative.
19
- ValueError: If [`leading_indent`][(c).] is negative.
20
- ValueError: If [`trailing_indent`][(c).] is negative.
16
+ ```python
17
+ ft.Column(
18
+ width=240,
19
+ spacing=10,
20
+ controls=[
21
+ ft.Text("Section A", weight=ft.FontWeight.W_600),
22
+ ft.Divider(),
23
+ ft.Text("Section B"),
24
+ ],
25
+ )
26
+ ```
21
27
  """
22
28
 
23
29
  color: Optional[ColorValue] = None
@@ -34,6 +40,9 @@ class Divider(Control):
34
40
 
35
41
  If `None`, [`DividerTheme.space`][flet.] is used.
36
42
  If that's is also `None`, defaults to `16.0`.
43
+
44
+ Raises:
45
+ ValueError: If [`height`][(c).] is negative.
37
46
  """
38
47
 
39
48
  leading_indent: Optional[Number] = None
@@ -42,6 +51,9 @@ class Divider(Control):
42
51
 
43
52
  If `None`, [`DividerTheme.leading_indent`][flet.] is used.
44
53
  If that's is also `None`, defaults to `0.0`.
54
+
55
+ Raises:
56
+ ValueError: If [`leading_indent`][(c).] is negative.
45
57
  """
46
58
 
47
59
  thickness: Optional[Number] = None
@@ -53,6 +65,9 @@ class Divider(Control):
53
65
 
54
66
  If `None`, [`DividerTheme.thickness`][flet.] is used.
55
67
  If that is also `None`, defaults to `0.0`.
68
+
69
+ Raises:
70
+ ValueError: If [`thickness`][(c).] is negative.
56
71
  """
57
72
 
58
73
  trailing_indent: Optional[Number] = None
@@ -61,6 +76,9 @@ class Divider(Control):
61
76
 
62
77
  If `None`, [`DividerTheme.trailing_indent`][flet.] is used.
63
78
  If that is also `None`, defaults to `0.0`.
79
+
80
+ Raises:
81
+ ValueError: If [`trailing_indent`][(c).] is negative.
64
82
  """
65
83
 
66
84
  radius: Optional[BorderRadiusValue] = None
@@ -30,9 +30,6 @@ class DropdownOption(Control):
30
30
  """
31
31
  Represents an item in a dropdown. Either `key` or `text` must be specified, else an
32
32
  `AssertionError` will be raised.
33
-
34
- Raises:
35
- ValueError: If neither [`key`][(c).] nor [`text`][(c).] are provided.
36
33
  """
37
34
 
38
35
  key: Optional[str] = None
@@ -44,6 +41,9 @@ class DropdownOption(Control):
44
41
  text: Optional[str] = None
45
42
  """
46
43
  Option's display text. If not specified `key` will be used as fallback.
44
+
45
+ Raises:
46
+ ValueError: If neither [`key`][(c).] nor [`text`][(c).] are provided.
47
47
  """
48
48
 
49
49
  content: Optional[Control] = None
@@ -81,6 +81,17 @@ class Dropdown(LayoutControl):
81
81
  """
82
82
  A dropdown control that allows users to select a single option from a list of
83
83
  options.
84
+
85
+ ```python
86
+ ft.Dropdown(
87
+ width=220,
88
+ value="alice",
89
+ options=[
90
+ ft.dropdown.Option(key="alice", text="Alice"),
91
+ ft.dropdown.Option(key="bob", text="Bob"),
92
+ ],
93
+ )
94
+ ```
84
95
  """
85
96
 
86
97
  value: Optional[str] = None
@@ -69,6 +69,17 @@ class DropdownM2(FormFieldControl):
69
69
  A dropdown lets the user select from a number of items. The dropdown shows the
70
70
  currently selected item as well as an arrow that opens a menu for selecting another
71
71
  item.
72
+
73
+ ```python
74
+ ft.DropdownM2(
75
+ width=220,
76
+ value="Alice",
77
+ options=[
78
+ ft.dropdownm2.Option(key="Alice", text="Alice"),
79
+ ft.dropdownm2.Option(key="Bob", text="Bob"),
80
+ ],
81
+ )
82
+ ```
72
83
  """
73
84
 
74
85
  value: Optional[str] = None
@@ -20,6 +20,23 @@ class ExpansionPanel(LayoutControl, AdaptiveControl):
20
20
  """
21
21
  A material expansion panel. It can either be expanded or collapsed. Its body is
22
22
  only visible when it is expanded.
23
+
24
+ ```python
25
+ ft.ExpansionPanelList(
26
+ width=400,
27
+ controls=[
28
+ ft.ExpansionPanel(
29
+ header=ft.Text("Shipping address"),
30
+ content=ft.Text("123 Market Street, Springfield"),
31
+ expanded=True,
32
+ ),
33
+ ft.ExpansionPanel(
34
+ header=ft.Text("Billing address"),
35
+ content=ft.Text("Same as shipping"),
36
+ ),
37
+ ],
38
+ )
39
+ ```
23
40
  """
24
41
 
25
42
  header: Optional[Control] = None
@@ -71,6 +88,23 @@ class ExpansionPanel(LayoutControl, AdaptiveControl):
71
88
  class ExpansionPanelList(LayoutControl):
72
89
  """
73
90
  A material expansion panel list that lays out its children and animates expansions.
91
+
92
+ ```python
93
+ ft.ExpansionPanelList(
94
+ width=400,
95
+ controls=[
96
+ ft.ExpansionPanel(
97
+ header=ft.Text("Details"),
98
+ content=ft.Text("More information here"),
99
+ expanded=True,
100
+ ),
101
+ ft.ExpansionPanel(
102
+ header=ft.Text("History"),
103
+ content=ft.Text("View previous updates"),
104
+ ),
105
+ ],
106
+ )
107
+ ```
74
108
  """
75
109
 
76
110
  controls: list[ExpansionPanel] = field(default_factory=list)
@@ -34,8 +34,18 @@ class ExpansionTile(LayoutControl, AdaptiveControl):
34
34
  A single-line ListTile with an expansion arrow icon that expands or collapses the
35
35
  tile to reveal or hide its controls.
36
36
 
37
- Raises:
38
- ValueError: If [`title`][(c).] is neither a string nor a visible Control.
37
+ ```python
38
+ ft.ExpansionTile(
39
+ width=400,
40
+ title="Account",
41
+ subtitle="Manage profile and security",
42
+ controls=[
43
+ ft.ListTile(title=ft.Text("Profile")),
44
+ ft.ListTile(title=ft.Text("Security")),
45
+ ],
46
+ initially_expanded=True,
47
+ )
48
+ ```
39
49
  """
40
50
 
41
51
  title: StrOrControl
@@ -43,6 +53,9 @@ class ExpansionTile(LayoutControl, AdaptiveControl):
43
53
  A `Control` to display as primary content of the tile.
44
54
 
45
55
  Typically a [`Text`][flet.] control.
56
+
57
+ Raises:
58
+ ValueError: If [`title`][(c).] is neither a string nor a visible Control.
46
59
  """
47
60
 
48
61
  controls: Optional[list[Control]] = None
@@ -9,6 +9,10 @@ class FilledButton(Button):
9
9
  [`FloatingActionButton`][flet.], and is typically used for
10
10
  important, final actions that complete a flow, like "Save",
11
11
  "Join now", or "Confirm".
12
+
13
+ ```python
14
+ ft.FilledButton(content="Tap me")
15
+ ```
12
16
  """
13
17
 
14
18
  pass
@@ -9,6 +9,10 @@ class FilledTonalButton(Button):
9
9
  OutlinedButton buttons. They're useful in contexts where a lower-priority button
10
10
  requires slightly more emphasis than an outline would give, such as "Next" in an
11
11
  onboarding flow. Tonal buttons use the secondary color mapping.
12
+
13
+ ```python
14
+ ft.FilledTonalButton(content="Tap me")
15
+ ```
12
16
  """
13
17
 
14
18
  pass
@@ -26,18 +26,18 @@ class FloatingActionButton(LayoutControl):
26
26
  to `page.floating_action_button`, but can also be added as a regular control at any
27
27
  place on a page.
28
28
 
29
- Raises:
30
- ValueError: If neither [`icon`][(c).] nor a valid [`content`][(c).]
31
- (string or visible Control) is provided.
32
- ValueError: If [`elevation`][(c).],
33
- [`disabled_elevation`][(c).], [`focus_elevation`][(c).],
34
- [`highlight_elevation`][(c).], or [`hover_elevation`][(c).]
35
- is negative.
29
+ ```python
30
+ ft.FloatingActionButton(icon=ft.Icons.ADD)
31
+ ```
36
32
  """
37
33
 
38
34
  content: Optional[StrOrControl] = None
39
35
  """
40
36
  The content of this button.
37
+
38
+ Raises:
39
+ ValueError: If neither [`icon`][(c).] nor a valid [`content`][(c).]
40
+ (string or visible Control) is provided.
41
41
  """
42
42
 
43
43
  icon: Optional[IconDataOrControl] = None
@@ -93,6 +93,9 @@ class FloatingActionButton(LayoutControl):
93
93
  The elevation of this button.
94
94
 
95
95
  Defaults to `6`.
96
+
97
+ Raises:
98
+ ValueError: If [`elevation`][(c).] is negative.
96
99
  """
97
100
 
98
101
  disabled_elevation: Optional[Number] = None
@@ -100,6 +103,9 @@ class FloatingActionButton(LayoutControl):
100
103
  The elevation of this button when disabled.
101
104
 
102
105
  Defaults to the same value as `elevation`.
106
+
107
+ Raises:
108
+ ValueError: If [`disabled_elevation`][(c).] is negative.
103
109
  """
104
110
 
105
111
  focus_elevation: Optional[Number] = None
@@ -107,6 +113,9 @@ class FloatingActionButton(LayoutControl):
107
113
  The elevation of this button when it has input focus.
108
114
 
109
115
  Defaults to `8`.
116
+
117
+ Raises:
118
+ ValueError: If [`focus_elevation`][(c).] is negative.
110
119
  """
111
120
 
112
121
  highlight_elevation: Optional[Number] = None
@@ -114,6 +123,9 @@ class FloatingActionButton(LayoutControl):
114
123
  The elevation of this button when it is highlighted.
115
124
 
116
125
  Defaults to `12`.
126
+
127
+ Raises:
128
+ ValueError: If [`highlight_elevation`][(c).] is negative.
117
129
  """
118
130
 
119
131
  hover_elevation: Optional[Number] = None
@@ -121,6 +133,9 @@ class FloatingActionButton(LayoutControl):
121
133
  The elevation of this button it is enabled and being hovered over.
122
134
 
123
135
  Defaults to `8`.
136
+
137
+ Raises:
138
+ ValueError: If [`hover_elevation`][(c).] is negative.
124
139
  """
125
140
 
126
141
  hover_color: Optional[ColorValue] = None
@@ -35,8 +35,9 @@ class IconButton(LayoutControl, AdaptiveControl):
35
35
  Icon buttons are commonly used in the toolbars, but they can be used in many other
36
36
  places as well.
37
37
 
38
- Raises:
39
- ValueError: If [`splash_radius`][(c).] is not greater than `0`.
38
+ ```python
39
+ ft.IconButton(icon=ft.Icons.FAVORITE, icon_color=ft.Colors.PRIMARY)
40
+ ```
40
41
  """
41
42
 
42
43
  icon: Optional[IconDataOrControl] = None
@@ -136,6 +137,9 @@ class IconButton(LayoutControl, AdaptiveControl):
136
137
  Note:
137
138
  This value is honoured only when in Material 2
138
139
  ([`Theme.use_material3`][flet.] is `False`).
140
+
141
+ Raises:
142
+ ValueError: If [`splash_radius`][(c).] is not greater than `0`.
139
143
  """
140
144
 
141
145
  alignment: Optional[Alignment] = None
@@ -233,6 +237,10 @@ class FilledIconButton(IconButton):
233
237
 
234
238
  Filled icon buttons have higher visual impact and should be used for high emphasis
235
239
  actions, such as turning off a microphone or camera.
240
+
241
+ ```python
242
+ ft.FilledIconButton(icon=ft.Icons.CHECK)
243
+ ```
236
244
  """
237
245
 
238
246
 
@@ -245,6 +253,10 @@ class FilledTonalIconButton(IconButton):
245
253
  outlined icon buttons. They're useful in contexts where the button requires
246
254
  slightly more emphasis than an outline would give, such as a secondary action
247
255
  paired with a high emphasis action.
256
+
257
+ ```python
258
+ ft.FilledTonalIconButton(icon=ft.Icons.CHECK)
259
+ ```
248
260
  """
249
261
 
250
262
 
@@ -47,6 +47,17 @@ class ListTile(LayoutControl, AdaptiveControl):
47
47
  """
48
48
  A single fixed-height row that typically contains some text as well as a leading or
49
49
  trailing icon.
50
+
51
+ ```python
52
+ ft.ListTile(
53
+ width=400,
54
+ leading=ft.Icon(ft.Icons.ACCOUNT_CIRCLE),
55
+ title="Jane Doe",
56
+ subtitle="Product Manager",
57
+ trailing=ft.Icon(ft.Icons.CHEVRON_RIGHT),
58
+ bgcolor=ft.Colors.SURFACE_CONTAINER_LOW,
59
+ )
60
+ ```
50
61
  """
51
62
 
52
63
  title: Optional[StrOrControl] = None
@@ -81,11 +81,6 @@ class NavigationRail(LayoutControl):
81
81
  """
82
82
  A material widget that is meant to be displayed at the left or right of an app to
83
83
  navigate between a small number of views, typically between three and five.
84
-
85
- Raises:
86
- ValueError: If [`elevation`][(c).] is negative.
87
- ValueError: If [`min_width`][(c).] is negative.
88
- ValueError: If [`min_extended_width`][(c).] is negative.
89
84
  """
90
85
 
91
86
  destinations: list[NavigationRailDestination] = field(default_factory=list)
@@ -101,6 +96,9 @@ class NavigationRail(LayoutControl):
101
96
  Controls the size of the shadow below the NavigationRail.
102
97
 
103
98
  Defaults to `0.0`.
99
+
100
+ Raises:
101
+ ValueError: If [`elevation`][(c).] is negative.
104
102
  """
105
103
 
106
104
  selected_index: Optional[int] = None
@@ -180,6 +178,9 @@ class NavigationRail(LayoutControl):
180
178
  This value also defines the min width and min height of the destinations.
181
179
 
182
180
  To make a compact rail, set this to `56` and use `label_type='none'`.
181
+
182
+ Raises:
183
+ ValueError: If [`min_width`][(c).] is negative.
183
184
  """
184
185
 
185
186
  min_extended_width: Optional[Number] = None
@@ -187,6 +188,9 @@ class NavigationRail(LayoutControl):
187
188
  The final width when the animation is complete for setting `extended` to `True`.
188
189
 
189
190
  Defaults to `256`.
191
+
192
+ Raises:
193
+ ValueError: If [`min_extended_width`][(c).] is negative.
190
194
  """
191
195
 
192
196
  group_alignment: Optional[Number] = None
@@ -23,14 +23,14 @@ class OutlinedButton(LayoutControl, AdaptiveControl):
23
23
  Outlined buttons are medium-emphasis buttons. They contain actions that are
24
24
  important, but aren't the primary action in an app. Outlined buttons pair well with
25
25
  filled buttons to indicate an alternative, secondary action.
26
-
27
- Raises:
28
- ValueError: If neither [`icon`][(c).] nor [`content`][(c).] is provided.
29
26
  """
30
27
 
31
28
  content: Optional[StrOrControl] = None
32
29
  """
33
30
  A Control representing custom button content.
31
+
32
+ Raises:
33
+ ValueError: If neither [`icon`][(c).] nor [`content`][(c).] is provided.
34
34
  """
35
35
 
36
36
  icon: Optional[IconDataOrControl] = None