flet 0.70.0.dev6491__py3-none-any.whl → 0.70.0.dev6519__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.

@@ -1,12 +1,11 @@
1
1
  from dataclasses import field
2
- from enum import Enum
3
2
  from typing import Optional
4
3
 
4
+ from flet.controls.adaptive_control import AdaptiveControl
5
5
  from flet.controls.base_control import control
6
6
  from flet.controls.buttons import OutlinedBorder
7
7
  from flet.controls.control import Control
8
8
  from flet.controls.control_event import ControlEventHandler
9
- from flet.controls.dialog_control import DialogControl
10
9
  from flet.controls.padding import PaddingValue
11
10
  from flet.controls.types import (
12
11
  ColorValue,
@@ -17,7 +16,6 @@ from flet.controls.types import (
17
16
  __all__ = [
18
17
  "NavigationDrawer",
19
18
  "NavigationDrawerDestination",
20
- "NavigationDrawerPosition",
21
19
  ]
22
20
 
23
21
 
@@ -74,13 +72,8 @@ class NavigationDrawerDestination(Control):
74
72
  """
75
73
 
76
74
 
77
- class NavigationDrawerPosition(Enum):
78
- START = "start"
79
- END = "end"
80
-
81
-
82
75
  @control("NavigationDrawer")
83
- class NavigationDrawer(DialogControl):
76
+ class NavigationDrawer(AdaptiveControl):
84
77
  """
85
78
  Material Design Navigation Drawer component.
86
79
 
@@ -138,12 +131,12 @@ class NavigationDrawer(DialogControl):
138
131
  Defines the padding for `destination` controls.
139
132
  """
140
133
 
141
- position: NavigationDrawerPosition = NavigationDrawerPosition.START
134
+ on_change: Optional[ControlEventHandler["NavigationDrawer"]] = None
142
135
  """
143
- The position of this drawer.
136
+ Called when selected destination changed.
144
137
  """
145
138
 
146
- on_change: Optional[ControlEventHandler["NavigationDrawer"]] = None
139
+ on_dismiss: Optional[ControlEventHandler["NavigationDrawer"]] = None
147
140
  """
148
- Called when selected destination changed.
141
+ Called when the drawer is dismissed.
149
142
  """
@@ -32,6 +32,11 @@ class Slider(LayoutControl, AdaptiveControl):
32
32
  Use a slider when you want people to set defined values (such as volume or
33
33
  brightness), or when people would benefit from instant feedback on the effect
34
34
  of setting changes.
35
+
36
+ ```python
37
+ ft.Slider(label="Slider", value=0.3)
38
+ ```
39
+
35
40
  """
36
41
 
37
42
  value: Optional[Number] = None
@@ -47,6 +47,8 @@ class SnackBarAction(Control):
47
47
  action, avoid including it in the snack bar in the first place.
48
48
  - Snack bar actions can will only respond to first click.
49
49
  Subsequent clicks/presses are ignored.
50
+
51
+
50
52
  """
51
53
 
52
54
  label: str
@@ -93,6 +95,11 @@ class SnackBar(DialogControl):
93
95
  """
94
96
  A lightweight message with an optional action which briefly displays at the
95
97
  bottom of the screen.
98
+
99
+ ```python
100
+ page.show_dialog(ft.SnackBar(ft.Text("Opened snack bar")))
101
+ ```
102
+
96
103
  """
97
104
 
98
105
  content: StrOrControl
@@ -25,10 +25,10 @@ class TextButton(LayoutControl, AdaptiveControl):
25
25
 
26
26
  ```python
27
27
  ft.TextButton(
28
- content="Text Button",
29
- icon=ft.Icons.STAR_BORDER,
30
- icon_color=ft.Colors.BLUE_300,
31
- )
28
+ content="Text Button",
29
+ icon=ft.Icons.STAR_BORDER,
30
+ icon_color=ft.Colors.BLUE_300,
31
+ )
32
32
  ```
33
33
  """
34
34
 
@@ -87,8 +87,8 @@ class TextButton(LayoutControl, AdaptiveControl):
87
87
  """
88
88
  Called when a mouse pointer enters or exists this button's response area.
89
89
 
90
- The [`data`][flet.Event.] property of event object is `True` when cursor
91
- enters and `False` when it exits.
90
+ The [`data`][flet.Event.] property of the event handler argument is `True` when
91
+ cursor enters and `False` when it exits.
92
92
  """
93
93
 
94
94
  on_focus: Optional[ControlEventHandler["TextButton"]] = None
@@ -14,6 +14,29 @@ class VerticalDivider(Control):
14
14
  A thin vertical line, with padding on either side.
15
15
 
16
16
  In the material design language, this represents a divider.
17
+
18
+ ```python
19
+ ft.Row(
20
+ width=120,
21
+ height=60,
22
+ expand=True,
23
+ spacing=0,
24
+ controls=[
25
+ ft.Container(
26
+ bgcolor=ft.Colors.BLUE_GREY_200,
27
+ alignment=ft.Alignment.CENTER,
28
+ expand=True,
29
+ ),
30
+ ft.VerticalDivider(),
31
+ ft.Container(
32
+ bgcolor=ft.Colors.GREY_500,
33
+ alignment=ft.Alignment.CENTER,
34
+ expand=True,
35
+ ),
36
+ ],
37
+ )
38
+ ```
39
+
17
40
  """
18
41
 
19
42
  width: Optional[Number] = None