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
@@ -34,15 +34,6 @@ class CupertinoDatePickerDateOrder(Enum):
34
34
  class CupertinoDatePicker(LayoutControl):
35
35
  """
36
36
  An iOS-styled date picker.
37
-
38
- Raises:
39
- ValueError: If [`item_extent`][(c).] is not strictly greater than `0`.
40
- ValueError: If [`minute_interval`][(c).] is not a positive integer
41
- factor of `60`.
42
- ValueError: If [`value`][(c).] is before [`first_date`][(c).] or
43
- after [`last_date`][(c).].
44
- ValueError: If [`value`][(c).] year is less than [`minimum_year`][(c).] or
45
- greater than [`maximum_year`][(c).].
46
37
  """
47
38
 
48
39
  value: DateTimeValue = field(default_factory=lambda: datetime.now())
@@ -54,6 +45,14 @@ class CupertinoDatePicker(LayoutControl):
54
45
  else a `ValueError` will be raised.
55
46
 
56
47
  Defaults to the present date and time.
48
+
49
+ Raises:
50
+ ValueError: If [`value`][(c).] is before [`first_date`][(c).] or
51
+ after [`last_date`][(c).].
52
+ ValueError: If [`value`][(c).] year is less than [`minimum_year`][(c).] or
53
+ greater than [`maximum_year`][(c).].
54
+ ValueError: If [`value`][(c).] minute is not divisible by
55
+ [`minute_interval`][(c).].
57
56
  """
58
57
 
59
58
  first_date: Optional[DateTimeValue] = None
@@ -100,12 +99,19 @@ class CupertinoDatePicker(LayoutControl):
100
99
 
101
100
  Note:
102
101
  Must be an integer factor of `60`.
102
+
103
+ Raises:
104
+ ValueError: If [`minute_interval`][(c).] is not a positive integer factor of
105
+ `60`.
103
106
  """
104
107
 
105
108
  minimum_year: int = 1
106
109
  """
107
110
  Minimum year to which the picker can be scrolled when in
108
111
  [`CupertinoDatePickerMode.DATE`][flet.] mode.
112
+
113
+ Raises:
114
+ ValueError: If [`value`][(c).] year is less than [`minimum_year`][(c).].
109
115
  """
110
116
 
111
117
  maximum_year: Optional[int] = None
@@ -114,11 +120,17 @@ class CupertinoDatePicker(LayoutControl):
114
120
  [`CupertinoDatePickerMode.DATE`][flet.] mode.
115
121
 
116
122
  Defaults to `None` - no limit.
123
+
124
+ Raises:
125
+ ValueError: If [`value`][(c).] year is greater than [`maximum_year`][(c).].
117
126
  """
118
127
 
119
128
  item_extent: Number = 32.0
120
129
  """
121
130
  The uniform height of all children.
131
+
132
+ Raises:
133
+ ValueError: If [`item_extent`][(c).] is not strictly greater than `0`.
122
134
  """
123
135
 
124
136
  use_24h_format: bool = False
@@ -131,6 +143,11 @@ class CupertinoDatePicker(LayoutControl):
131
143
  show_day_of_week: bool = False
132
144
  """
133
145
  Whether to show day of week alongside day.
146
+
147
+ Raises:
148
+ ValueError: If [`show_day_of_week`][(c).] is set when
149
+ [`date_picker_mode`][(c).] is not
150
+ [`CupertinoDatePickerMode.DATE`][flet.].
134
151
  """
135
152
 
136
153
  date_picker_mode: CupertinoDatePickerMode = CupertinoDatePickerMode.DATE_AND_TIME
@@ -15,14 +15,14 @@ class CupertinoDialogAction(Control):
15
15
  A dialog action button.
16
16
 
17
17
  Typically used as a child of [`CupertinoAlertDialog.actions`][flet.].
18
-
19
- Raises:
20
- ValueError: If [`content`][(c).] is neither a string nor a visible Control.
21
18
  """
22
19
 
23
20
  content: StrOrControl
24
21
  """
25
22
  The content of this action button.
23
+
24
+ Raises:
25
+ ValueError: If [`content`][(c).] is neither a string nor a visible Control.
26
26
  """
27
27
 
28
28
  default: bool = False
@@ -8,4 +8,8 @@ __all__ = ["CupertinoFilledButton"]
8
8
  class CupertinoFilledButton(CupertinoButton):
9
9
  """
10
10
  An iOS-style button filled with default background color.
11
+
12
+ ```python
13
+ ft.CupertinoFilledButton("Tap me")
14
+ ```
11
15
  """
@@ -20,10 +20,18 @@ class CupertinoListTile(LayoutControl):
20
20
  """
21
21
  An iOS-style list tile.
22
22
 
23
- Can also serve as a cupertino equivalent of the Material [`ListTile`][flet.].
23
+ The CupertinoListTile is a Cupertino equivalent of the Material [`ListTile`][flet.].
24
24
 
25
- Raises:
26
- ValueError: If [`title`][(c).] is neither a string nor a visible Control.
25
+ ```python
26
+ ft.CupertinoListTile(
27
+ title="Notifications",
28
+ subtitle="Enabled",
29
+ width=400,
30
+ leading=ft.Icon(ft.Icons.NOTIFICATIONS_OUTLINED),
31
+ trailing=ft.Icon(ft.Icons.CHEVRON_RIGHT),
32
+ bgcolor=ft.Colors.SURFACE_CONTAINER_LOW,
33
+ )
34
+ ```
27
35
  """
28
36
 
29
37
  title: StrOrControl
@@ -31,6 +39,9 @@ class CupertinoListTile(LayoutControl):
31
39
  The primary content of this list tile.
32
40
 
33
41
  Typically a [`Text`][flet.] control.
42
+
43
+ Raises:
44
+ ValueError: If [`title`][(c).] is neither a string nor a visible Control.
34
45
  """
35
46
 
36
47
  subtitle: Optional[StrOrControl] = None
@@ -21,11 +21,6 @@ class CupertinoNavigationBar(LayoutControl):
21
21
 
22
22
  Navigation bars offer a persistent and convenient way to switch between primary
23
23
  destinations in an app.
24
-
25
- Raises:
26
- ValueError: If [`destinations`][(c).] does not contain at least two visible
27
- [`NavigationBarDestination`][flet.]s.
28
- IndexError: If [`selected_index`][(c).] is out of range.
29
24
  """
30
25
 
31
26
  destinations: list[NavigationBarDestination]
@@ -34,6 +29,10 @@ class CupertinoNavigationBar(LayoutControl):
34
29
 
35
30
  Note:
36
31
  Must be a list of two or more [`NavigationBarDestination`][flet.]s.
32
+
33
+ Raises:
34
+ ValueError: If [`destinations`][(c).] does not contain at least two visible
35
+ [`NavigationBarDestination`][flet.]s.
37
36
  """
38
37
 
39
38
  selected_index: int = 0
@@ -44,6 +43,10 @@ class CupertinoNavigationBar(LayoutControl):
44
43
  Note:
45
44
  Must be a value between `0` and the length of visible
46
45
  [`destinations`][(c).], inclusive.
46
+
47
+ Raises:
48
+ IndexError: If [`selected_index`][(c).] is out of range relative to the
49
+ visible destinations.
47
50
  """
48
51
 
49
52
  bgcolor: Optional[ColorValue] = None
@@ -18,10 +18,6 @@ __all__ = ["CupertinoPicker"]
18
18
  class CupertinoPicker(LayoutControl):
19
19
  """
20
20
  An iOS-styled picker.
21
-
22
- Raises:
23
- ValueError: If [`item_extent`][(c).], [`squeeze`][(c).],
24
- or [`magnification`][(c).] is not strictly greater than `0.0`.
25
21
  """
26
22
 
27
23
  controls: list[Control] = field(default_factory=list)
@@ -32,6 +28,9 @@ class CupertinoPicker(LayoutControl):
32
28
  item_extent: Number = 32.0
33
29
  """
34
30
  The uniform height of all [`controls`][(c).].
31
+
32
+ Raises:
33
+ ValueError: If [`item_extent`][(c).] is not strictly greater than `0.0`.
35
34
  """
36
35
 
37
36
  selected_index: int = 0
@@ -64,11 +63,17 @@ class CupertinoPicker(LayoutControl):
64
63
 
65
64
  Note:
66
65
  Has effect only if [`use_magnifier`][(c).] is `True`.
66
+
67
+ Raises:
68
+ ValueError: If [`magnification`][(c).] is not strictly greater than `0.0`.
67
69
  """
68
70
 
69
71
  squeeze: Number = 1.45
70
72
  """
71
73
  The angular compactness of the children on the wheel.
74
+
75
+ Raises:
76
+ ValueError: If [`squeeze`][(c).] is not strictly greater than `0.0`.
72
77
  """
73
78
 
74
79
  diameter_ratio: Number = 1.07
@@ -18,6 +18,20 @@ class CupertinoRadio(LayoutControl):
18
18
  """
19
19
  A macOS-styled radio button, allowing the user to select a single option from two
20
20
  or more choices.
21
+
22
+ ```python
23
+ ft.RadioGroup(
24
+ value="option_2",
25
+ content=ft.Column(
26
+ intrinsic_width=True,
27
+ controls=[
28
+ ft.CupertinoRadio(value="option_1", label="Option 1"),
29
+ ft.CupertinoRadio(value="option_2", label="Option 2"),
30
+ ft.CupertinoRadio(value="option_3", label="Option 3"),
31
+ ],
32
+ ),
33
+ )
34
+ ```
21
35
  """
22
36
 
23
37
  label: Optional[str] = None
@@ -15,10 +15,16 @@ class CupertinoSegmentedButton(LayoutControl):
15
15
  """
16
16
  An iOS-style segmented button.
17
17
 
18
- Raises:
19
- ValueError: If [`controls`][(c).] does not contain at least two visible
20
- controls.
21
- IndexError: If [`selected_index`][(c).] is out of range.
18
+ ```python
19
+ ft.CupertinoSegmentedButton(
20
+ controls=[
21
+ ft.Text("One"),
22
+ ft.Text("Two"),
23
+ ft.Text("Three"),
24
+ ],
25
+ selected_index=1,
26
+ )
27
+ ```
22
28
  """
23
29
 
24
30
  controls: list[Control]
@@ -27,12 +33,20 @@ class CupertinoSegmentedButton(LayoutControl):
27
33
 
28
34
  Note:
29
35
  Must contain at least two visible Controls.
36
+
37
+ Raises:
38
+ ValueError: If [`controls`][(c).] does not contain at least two visible
39
+ controls.
30
40
  """
31
41
 
32
42
  selected_index: int = 0
33
43
  """
34
44
  The index (starting from 0) of the selected segment in the
35
45
  [`controls`][(c).] list.
46
+
47
+ Raises:
48
+ IndexError: If [`selected_index`][(c).] is out of range relative to the
49
+ visible controls.
36
50
  """
37
51
 
38
52
  selected_color: Optional[ColorValue] = None
@@ -23,10 +23,9 @@ class CupertinoSlider(LayoutControl):
23
23
  brightness), or when people would benefit from instant feedback on the effect of
24
24
  setting changes.
25
25
 
26
- Raises:
27
- ValueError: If [`min`][(c).] is greater than [`max`][(c).].
28
- ValueError: If [`value`][(c).] is less than [`min`][(c).].
29
- ValueError: If [`value`][(c).] is greater than [`max`][(c).].
26
+ ```python
27
+ ft.CupertinoSlider(value=0.6)
28
+ ```
30
29
  """
31
30
 
32
31
  value: Optional[Number] = None
@@ -34,6 +33,10 @@ class CupertinoSlider(LayoutControl):
34
33
  The currently selected value for this slider.
35
34
 
36
35
  The slider's thumb is drawn at a position that corresponds to this value.
36
+
37
+ Raises:
38
+ ValueError: If [`value`][(c).] is less than [`min`][(c).] or greater than
39
+ [`max`][(c).].
37
40
  """
38
41
 
39
42
  min: Number = 0.0
@@ -43,6 +46,9 @@ class CupertinoSlider(LayoutControl):
43
46
  Note:
44
47
  - Must be less than or equal to [`max`][(c).].
45
48
  - If the [`max`][(c).] is equal to the `min`, then this slider is disabled.
49
+
50
+ Raises:
51
+ ValueError: If [`min`][(c).] is greater than [`max`][(c).].
46
52
  """
47
53
 
48
54
  max: Number = 1.0
@@ -52,6 +58,9 @@ class CupertinoSlider(LayoutControl):
52
58
  Note:
53
59
  - Must be greater than or equal to [`min`][(c).].
54
60
  - If the [`min`][(c).] is equal to the `max`, then this slider is disabled.
61
+
62
+ Raises:
63
+ ValueError: If [`max`][(c).] is less than [`min`][(c).].
55
64
  """
56
65
 
57
66
  divisions: Optional[int] = None
@@ -19,10 +19,16 @@ class CupertinoSlidingSegmentedButton(LayoutControl):
19
19
  """
20
20
  A cupertino sliding segmented button.
21
21
 
22
- Raises:
23
- ValueError: If [`controls`][(c).] does not contain at least two
24
- visible controls.
25
- IndexError: If [`selected_index`][(c).] is out of range.
22
+ ```python
23
+ ft.CupertinoSlidingSegmentedButton(
24
+ controls=[
25
+ ft.Text("One"),
26
+ ft.Text("Two"),
27
+ ft.Text("Three"),
28
+ ],
29
+ selected_index=1,
30
+ )
31
+ ```
26
32
  """
27
33
 
28
34
  controls: list[Control]
@@ -31,11 +37,19 @@ class CupertinoSlidingSegmentedButton(LayoutControl):
31
37
 
32
38
  Note:
33
39
  Must contain at least two visible Controls.
40
+
41
+ Raises:
42
+ ValueError: If [`controls`][(c).] does not contain at least two
43
+ visible controls.
34
44
  """
35
45
 
36
46
  selected_index: int = 0
37
47
  """
38
48
  The index (starting from 0) of the selected segment in the [`controls`][(c).] list.
49
+
50
+ Raises:
51
+ IndexError: If [`selected_index`][(c).] is out of range relative to the
52
+ visible controls.
39
53
  """
40
54
 
41
55
  bgcolor: ColorValue = CupertinoColors.TERTIARY_SYSTEM_FILL
@@ -20,6 +20,10 @@ class CupertinoSwitch(LayoutControl):
20
20
  An iOS-style switch.
21
21
 
22
22
  Used to toggle the on/off state of a single setting.
23
+
24
+ ```python
25
+ ft.CupertinoSwitch(value=True)
26
+ ```
23
27
  """
24
28
 
25
29
  label: Optional[str] = None
@@ -24,6 +24,10 @@ class OverlayVisibilityMode(Enum):
24
24
  class CupertinoTextField(TextField):
25
25
  """
26
26
  An iOS-style text field.
27
+
28
+ ```python
29
+ ft.CupertinoTextField(placeholder_text="Search")
30
+ ```
27
31
  """
28
32
 
29
33
  placeholder_text: Optional[str] = None
@@ -25,19 +25,6 @@ class CupertinoTimerPicker(LayoutControl):
25
25
 
26
26
  It can show a countdown duration with hour, minute and second spinners. The
27
27
  duration is bound between `0` and `23` hours `59` minutes `59` seconds.
28
-
29
- Raises:
30
- ValueError: If [`value`][(c).] is negative.
31
- ValueError: If [`value`][(c).] is 24 hours or more.
32
- ValueError: If [`minute_interval`][(c).] is not a positive integer
33
- factor of `60`.
34
- ValueError: If [`second_interval`][(c).] is not a positive integer
35
- factor of `60`.
36
- ValueError: If [`value`][(c).] is not a multiple
37
- of [`minute_interval`][(c).].
38
- ValueError: If [`value`][(c).] is not a multiple
39
- of [`second_interval`][(c).].
40
- ValueError: If [`item_extent`][(c).] is not strictly greater than `0.0`.
41
28
  """
42
29
 
43
30
  value: DurationValue = field(default_factory=lambda: Duration())
@@ -45,6 +32,11 @@ class CupertinoTimerPicker(LayoutControl):
45
32
  The initial duration of the countdown timer.
46
33
 
47
34
  If specified as an integer, it will be assumed to be in seconds.
35
+
36
+ Raises:
37
+ ValueError: If [`value`][(c).] is negative or 24 hours or more.
38
+ ValueError: If [`value`][(c).] is not a multiple
39
+ of [`minute_interval`][(c).] or [`second_interval`][(c).].
48
40
  """
49
41
 
50
42
  alignment: Alignment = field(default_factory=lambda: Alignment.CENTER)
@@ -58,6 +50,10 @@ class CupertinoTimerPicker(LayoutControl):
58
50
 
59
51
  Note:
60
52
  Must be a positive integer factor of `60`.
53
+
54
+ Raises:
55
+ ValueError: If [`second_interval`][(c).] is not a positive integer factor of
56
+ `60`.
61
57
  """
62
58
 
63
59
  minute_interval: int = 1
@@ -66,6 +62,10 @@ class CupertinoTimerPicker(LayoutControl):
66
62
 
67
63
  Note:
68
64
  Must be a positive integer factor of `60`.
65
+
66
+ Raises:
67
+ ValueError: If [`minute_interval`][(c).] is not a positive integer factor of
68
+ `60`.
69
69
  """
70
70
 
71
71
  mode: CupertinoTimerPickerMode = CupertinoTimerPickerMode.HOUR_MINUTE_SECONDS
@@ -81,6 +81,9 @@ class CupertinoTimerPicker(LayoutControl):
81
81
  item_extent: Number = 32.0
82
82
  """
83
83
  The uniform height of all children.
84
+
85
+ Raises:
86
+ ValueError: If [`item_extent`][(c).] is not strictly greater than `0.0`.
84
87
  """
85
88
 
86
89
  on_change: Optional[ControlEventHandler["CupertinoTimerPicker"]] = None
@@ -8,4 +8,8 @@ __all__ = ["CupertinoTintedButton"]
8
8
  class CupertinoTintedButton(CupertinoButton):
9
9
  """
10
10
  An iOS-style button filled with default background color.
11
+
12
+ ```python
13
+ ft.CupertinoTintedButton("Tap me")
14
+ ```
11
15
  """
@@ -27,10 +27,6 @@ class AlertDialog(DialogControl):
27
27
  It has an optional [`title`][(c).] and an optional list of [`actions`][(c).] . The
28
28
  `title` is displayed above the [`content`][(c).] and the `actions` are displayed
29
29
  below the `content`.
30
-
31
- Raises:
32
- ValueError: If none of [`title`][(c).], [`content`][(c).], or
33
- [`actions`][(c).] are provided, as the dialog would have nothing to display.
34
30
  """
35
31
 
36
32
  content: Optional[Control] = None
@@ -59,6 +55,10 @@ class AlertDialog(DialogControl):
59
55
  A set of actions that are displayed at the bottom of this dialog.
60
56
 
61
57
  Typically this is a list of [`TextButton`][flet.] controls.
58
+
59
+ Raises:
60
+ ValueError: If none of [`title`][(c).], [`content`][(c).], or
61
+ [`actions`][(c).] are provided, as the dialog would have nothing to display.
62
62
  """
63
63
 
64
64
  bgcolor: Optional[ColorValue] = None
@@ -18,12 +18,6 @@ from flet.controls.types import (
18
18
  class AppBar(AdaptiveControl):
19
19
  """
20
20
  A material design app bar.
21
-
22
- Raises:
23
- ValueError: If [`elevation`][(c).] is negative.
24
- ValueError: If [`elevation_on_scroll`][(c).] is negative.
25
- ValueError: If [`toolbar_opacity`][(c).] is not between `0.0`
26
- and `1.0` inclusive.
27
21
  """
28
22
 
29
23
  leading: Optional[Control] = None
@@ -95,11 +89,17 @@ class AppBar(AdaptiveControl):
95
89
  Note:
96
90
  This effect is only visible when using the Material 2 design
97
91
  (when [`Theme.use_material3`][flet.] is `False`).
92
+
93
+ Raises:
94
+ ValueError: If [`elevation`][(c).] is negative.
98
95
  """
99
96
 
100
97
  elevation_on_scroll: Optional[Number] = None
101
98
  """
102
99
  The elevation to be used if this app bar has something scrolled underneath it.
100
+
101
+ Raises:
102
+ ValueError: If [`elevation_on_scroll`][(c).] is negative.
103
103
  """
104
104
 
105
105
  shadow_color: Optional[ColorValue] = None
@@ -173,6 +173,10 @@ class AppBar(AdaptiveControl):
173
173
 
174
174
  Note:
175
175
  Must be in the range `0.0` (transparent) to `1.0` (fully opaque).
176
+
177
+ Raises:
178
+ ValueError: If [`toolbar_opacity`][(c).] is not between `0.0`
179
+ and `1.0` inclusive.
176
180
  """
177
181
 
178
182
  title_text_style: Optional[TextStyle] = None
@@ -26,12 +26,6 @@ class Banner(DialogControl):
26
26
  Banners are displayed at the top of the screen, below a top app bar. They are
27
27
  persistent and non-modal, allowing the user to either ignore them or interact with
28
28
  them at any time.
29
-
30
- Raises:
31
- ValueError: if [`content`][(c).] is not visible.
32
- ValueError: if [`elevation`][(c).] is negative.
33
- ValueError: if [`actions`][(c).] does not contain at least one visible
34
- action Control.
35
29
  """
36
30
 
37
31
  content: StrOrControl
@@ -39,6 +33,9 @@ class Banner(DialogControl):
39
33
  The content of this banner.
40
34
 
41
35
  Typically a [`Text`][flet.] control.
36
+
37
+ Raises:
38
+ ValueError: If [`content`][(c).] is not visible.
42
39
  """
43
40
 
44
41
  actions: list[Control]
@@ -47,6 +44,10 @@ class Banner(DialogControl):
47
44
 
48
45
  Typically this is a list of [`TextButton`][flet.]
49
46
  controls.
47
+
48
+ Raises:
49
+ ValueError: If [`actions`][(c).] does not contain at least one visible
50
+ action Control.
50
51
  """
51
52
 
52
53
  leading: Optional[IconDataOrControl] = None
@@ -104,6 +105,9 @@ class Banner(DialogControl):
104
105
  elevation: Optional[Number] = None
105
106
  """
106
107
  The elevation of this banner.
108
+
109
+ Raises:
110
+ ValueError: If [`elevation`][(c).] is negative.
107
111
  """
108
112
 
109
113
  margin: Optional[MarginValue] = None
@@ -18,9 +18,6 @@ __all__ = ["BottomAppBar"]
18
18
  class BottomAppBar(LayoutControl):
19
19
  """
20
20
  A material design bottom app bar.
21
-
22
- Raises:
23
- ValueError: If [`elevation`][(c).] is negative.
24
21
  """
25
22
 
26
23
  content: Optional[Control] = None
@@ -70,6 +67,9 @@ class BottomAppBar(LayoutControl):
70
67
  elevation: Optional[Number] = None
71
68
  """
72
69
  This property controls the size of the shadow below this app bar.
70
+
71
+ Raises:
72
+ ValueError: If [`elevation`][(c).] is negative.
73
73
  """
74
74
 
75
75
  def before_update(self):
@@ -18,9 +18,6 @@ class BottomSheet(DialogControl):
18
18
 
19
19
  A bottom sheet is an alternative to a menu or dialog and prevents the user
20
20
  from interacting with the rest of the app.
21
-
22
- Raises:
23
- ValueError: If [`elevation`][(c).] is negative.
24
21
  """
25
22
 
26
23
  content: Control
@@ -31,6 +28,9 @@ class BottomSheet(DialogControl):
31
28
  elevation: Optional[Number] = None
32
29
  """
33
30
  Defines the size of the shadow below this bottom sheet.
31
+
32
+ Raises:
33
+ ValueError: If [`elevation`][(c).] is negative.
34
34
  """
35
35
 
36
36
  bgcolor: Optional[ColorValue] = None
@@ -22,6 +22,21 @@ class Card(LayoutControl, AdaptiveControl):
22
22
  """
23
23
  A material design card: a panel with slightly rounded corners and an elevation
24
24
  shadow.
25
+
26
+ ```python
27
+ ft.Card(
28
+ shadow_color=ft.Colors.ON_SURFACE_VARIANT,
29
+ content=ft.Container(
30
+ width=400,
31
+ padding=10,
32
+ content=ft.ListTile(
33
+ bgcolor=ft.Colors.GREY_400,
34
+ leading=ft.Icon(ft.Icons.FOREST),
35
+ title=ft.Text("Card Name"),
36
+ ),
37
+ ),
38
+ )
39
+ ```
25
40
  """
26
41
 
27
42
  content: Optional[Control] = None
@@ -25,6 +25,12 @@ class Checkbox(LayoutControl, AdaptiveControl):
25
25
  """
26
26
  Checkbox allows to select one or more items from a group, or switch between two
27
27
  mutually exclusive options (checked or unchecked, on or off).
28
+
29
+ ```python
30
+ ft.Checkbox()
31
+ ft.Checkbox(label="Checked", value=True)
32
+ ft.Checkbox(label="Disabled", disabled=True)
33
+ ```
28
34
  """
29
35
 
30
36
  label: Optional[StrOrControl] = None