flet 1.1.0.dev3__py3-none-any.whl → 1.1.0.dev4__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.
flet/app.py CHANGED
@@ -318,7 +318,11 @@ async def run_async(
318
318
  and url_prefix is None
319
319
  ):
320
320
  ensure_flet_desktop_package_installed()
321
- from flet_desktop import close_flet_view, open_flet_view_async
321
+ from flet_desktop import (
322
+ close_flet_view,
323
+ explain_client_exit,
324
+ open_flet_view_async,
325
+ )
322
326
 
323
327
  on_app_startup(conn.page_url)
324
328
 
@@ -329,6 +333,7 @@ async def run_async(
329
333
  )
330
334
  with contextlib.suppress(Exception):
331
335
  await fvp.wait()
336
+ explain_client_exit(fvp.returncode)
332
337
 
333
338
  close_flet_view(pid_file)
334
339
 
flet/controls/control.py CHANGED
@@ -69,9 +69,9 @@ class Control(BaseControl):
69
69
 
70
70
  This control spans the 12 virtual columns by default.
71
71
 
72
- | Breakpoint | Dimension |
72
+ | Breakpoint | Min width |
73
73
  |---|---|
74
- | xs | <576px |
74
+ | xs | ≥0px |
75
75
  | sm | ≥576px |
76
76
  | md | ≥768px |
77
77
  | lg | ≥992px |
@@ -65,6 +65,24 @@ class ResponsiveRow(LayoutControl, ScrollableControl, AdaptiveControl):
65
65
  ),
66
66
  message="columns must be greater than 0 for all breakpoints",
67
67
  ),
68
+ V.ensure(
69
+ lambda ctrl: (
70
+ ctrl.spacing >= 0
71
+ if isinstance(ctrl.spacing, (int, float))
72
+ else all(v >= 0 for v in ctrl.spacing.values())
73
+ ),
74
+ message="spacing must be greater than or equal to 0 for all breakpoints",
75
+ ),
76
+ V.ensure(
77
+ lambda ctrl: (
78
+ ctrl.run_spacing >= 0
79
+ if isinstance(ctrl.run_spacing, (int, float))
80
+ else all(v >= 0 for v in ctrl.run_spacing.values())
81
+ ),
82
+ message=(
83
+ "run_spacing must be greater than or equal to 0 for all breakpoints"
84
+ ),
85
+ ),
68
86
  )
69
87
 
70
88
  columns: ResponsiveNumber = 12
@@ -79,26 +97,39 @@ class ResponsiveRow(LayoutControl, ScrollableControl, AdaptiveControl):
79
97
  alignment: MainAxisAlignment = MainAxisAlignment.START
80
98
  """
81
99
  Defines how the child :attr:`controls` should be placed horizontally.
100
+
101
+ When the controls don't fit on one line and wrap, it applies to each line
102
+ separately.
82
103
  """
83
104
 
84
105
  vertical_alignment: CrossAxisAlignment = CrossAxisAlignment.START
85
106
  """
86
107
  Defines how the child :attr:`controls` should be placed vertically.
108
+
109
+ When the controls don't fit on one line and wrap, only
110
+ :attr:`~flet.CrossAxisAlignment.START`, :attr:`~flet.CrossAxisAlignment.END`
111
+ and :attr:`~flet.CrossAxisAlignment.CENTER` apply, within each line;
112
+ :attr:`~flet.CrossAxisAlignment.STRETCH` and
113
+ :attr:`~flet.CrossAxisAlignment.BASELINE` behave like
114
+ :attr:`~flet.CrossAxisAlignment.START`.
87
115
  """
88
116
 
89
117
  spacing: ResponsiveNumber = 10
90
118
  """
91
- The spacing between controls in a row in virtual pixels.
119
+ The horizontal spacing between controls, in logical pixels.
92
120
 
93
- Note:
94
- Has effect only when :attr:`alignment` is set to
95
- :attr:`flet.MainAxisAlignment.START`, :attr:`flet.MainAxisAlignment.END`,
96
- or :attr:`flet.MainAxisAlignment.CENTER`.
121
+ Raises:
122
+ ValueError: If it is negative.
123
+ ValueError: If any breakpoint-specific value is negative.
97
124
  """
98
125
 
99
126
  run_spacing: ResponsiveNumber = 10
100
127
  """
101
- The spacing between runs.
128
+ The vertical spacing between lines when the controls wrap, in logical pixels.
129
+
130
+ Raises:
131
+ ValueError: If it is negative.
132
+ ValueError: If any breakpoint-specific value is negative.
102
133
  """
103
134
 
104
135
  breakpoints: dict[Union[ResponsiveRowBreakpoint, str], Number] = field(
@@ -157,11 +157,18 @@ class RefreshIndicator(LayoutControl):
157
157
  """
158
158
  Dispatches events, and hides the progress indicator once
159
159
  :attr:`on_refresh` returns or raises.
160
+
161
+ :attr:`on_refresh` may re-render the component, which replaces this control with
162
+ a new instance that takes over its id. So the progress indicator is hidden
163
+ through whichever instance has the id when the handler finishes. If none
164
+ has it, the control was removed during the refresh, and removing it
165
+ already hid the progress indicator.
160
166
  """
161
167
  session = self.page.session if event_name == "refresh" else None
162
168
  try:
163
169
  await super()._trigger_event(event_name, event_data, e)
164
170
  finally:
165
- # Unmounting the client widget already finishes its refresh.
166
- if session is not None and session.index.get(self._i) is self:
167
- await self._invoke_method("finish_refresh")
171
+ if session is not None:
172
+ current = session.index.get(self._i)
173
+ if isinstance(current, RefreshIndicator):
174
+ await current._invoke_method("finish_refresh")
flet/controls/page.py CHANGED
@@ -532,6 +532,8 @@ class Page(BasePage):
532
532
  """
533
533
  Gets current app route.
534
534
 
535
+ In an app opened from a deep link, it starts as the link's path and query.
536
+
535
537
  Note:
536
538
  This property is read-only.
537
539
  """
@@ -669,8 +671,9 @@ class Page(BasePage):
669
671
 
670
672
  on_route_change: Optional[EventHandler[RouteChangeEvent]] = None
671
673
  """
672
- Called when page route changes either programmatically, by editing application URL \
673
- or using browser Back/Forward buttons.
674
+ Called when page route changes either programmatically, by editing application \
675
+ URL, using browser Back/Forward buttons, or when a deep link opens the running \
676
+ app.
674
677
  """
675
678
 
676
679
  on_view_pop: Optional[EventHandler[ViewPopEvent]] = None
@@ -112,9 +112,11 @@ class UrlLauncher(Service):
112
112
  `False` if there is no handler available,
113
113
  or the application does not have permission to check. For example:
114
114
 
115
- - On recent versions of Android and iOS, this will always return `False`
116
- unless the application has been configuration to allow querying the
117
- system for launch support.
115
+ - On Android 11+ and iOS, this returns `False` for URLs whose scheme
116
+ the app doesn't declare: on Android in
117
+ [`[tool.flet.android.queries]`](https://flet.dev/docs/publish/android#queries),
118
+ on iOS in `LSApplicationQueriesSchemes` of
119
+ [`[tool.flet.ios.info]`](https://flet.dev/docs/publish/ios#infoplist).
118
120
  - On web, this will always return `False` except for a few specific
119
121
  schemes that are always assumed to be supported (such as http(s)),
120
122
  as web pages are never allowed to query installed applications.
flet/utils/pip.py CHANGED
@@ -1,3 +1,4 @@
1
+ import importlib
1
2
  import os
2
3
  import subprocess
3
4
  import sys
@@ -91,7 +92,9 @@ def ensure_flet_desktop_package_installed():
91
92
 
92
93
  If `flet-desktop` is missing or its version differs from the current Flet SDK
93
94
  version, this function installs the expected package via
94
- `install_flet_package()`.
95
+ `install_flet_package()`. The `flet_desktop` modules loaded by the version
96
+ check are then dropped from `sys.modules`, so the caller's next import loads
97
+ the installed package rather than the one it replaced.
95
98
  """
96
99
  try:
97
100
  import flet_desktop.version
@@ -103,6 +106,9 @@ def ensure_flet_desktop_package_installed():
103
106
  raise RuntimeError("flet-desktop version mismatch")
104
107
  except Exception:
105
108
  install_flet_package("flet-desktop")
109
+ for name in [m for m in sys.modules if m.split(".")[0] == "flet_desktop"]:
110
+ del sys.modules[name]
111
+ importlib.invalidate_caches()
106
112
 
107
113
 
108
114
  def ensure_flet_web_package_installed():
flet/version.py CHANGED
@@ -16,7 +16,7 @@ __all__ = [
16
16
  ]
17
17
 
18
18
  # set by CI
19
- flet_version = "1.1.0.dev3"
19
+ flet_version = "1.1.0.dev4"
20
20
  """
21
21
  The Flet version in use.
22
22
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet
3
- Version: 1.1.0.dev3
3
+ Version: 1.1.0.dev4
4
4
  Summary: Flet for Python - easily build interactive multi-platform apps in Python
5
5
  Author-email: "Appveyor Systems Inc." <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -9,23 +9,23 @@ Project-URL: Repository, https://github.com/flet-dev/flet
9
9
  Project-URL: Documentation, https://flet.dev/docs/
10
10
  Requires-Python: >=3.10
11
11
  Description-Content-Type: text/markdown
12
- Requires-Dist: flet-cli==1.1.0.dev3; extra == "cli"
13
- Requires-Dist: flet-web==1.1.0.dev3; extra == "web"
12
+ Requires-Dist: flet-cli==1.1.0.dev4; extra == "cli"
13
+ Requires-Dist: flet-web==1.1.0.dev4; extra == "web"
14
14
  Requires-Dist: oauthlib>=3.2.2; platform_system != "Emscripten"
15
15
  Requires-Dist: httpx>=0.28.1; platform_system != "Emscripten"
16
16
  Requires-Dist: repath>=0.9.0
17
17
  Requires-Dist: msgpack>=1.1.0
18
18
  Requires-Dist: typing-extensions; python_version < "3.11"
19
19
  Provides-Extra: all
20
- Requires-Dist: flet-cli==1.1.0.dev3; extra == "all"
21
- Requires-Dist: flet-web==1.1.0.dev3; extra == "all"
22
- Requires-Dist: flet-desktop==1.1.0.dev3; extra == "all"
20
+ Requires-Dist: flet-cli==1.1.0.dev4; extra == "all"
21
+ Requires-Dist: flet-web==1.1.0.dev4; extra == "all"
22
+ Requires-Dist: flet-desktop==1.1.0.dev4; extra == "all"
23
23
  Provides-Extra: cli
24
- Requires-Dist: flet-cli==1.1.0.dev3; extra == "cli"
24
+ Requires-Dist: flet-cli==1.1.0.dev4; extra == "cli"
25
25
  Provides-Extra: desktop
26
- Requires-Dist: flet-desktop==1.1.0.dev3; extra == "desktop"
26
+ Requires-Dist: flet-desktop==1.1.0.dev4; extra == "desktop"
27
27
  Provides-Extra: web
28
- Requires-Dist: flet-web==1.1.0.dev3; extra == "web"
28
+ Requires-Dist: flet-web==1.1.0.dev4; extra == "web"
29
29
  Provides-Extra: test
30
30
  Requires-Dist: pytest>=7.2.0; extra == "test"
31
31
  Requires-Dist: pytest-asyncio>=1.1.0; extra == "test"
@@ -1,10 +1,10 @@
1
1
  flet/__init__.py,sha256=I-LCxnHfHwaGeuErv9EbXdVFayEjrJoXAdpQq2y271c,64958
2
- flet/app.py,sha256=B5E2nyrNQf5Ckr_YF4hpEjP_aY0rBgD0wKVWh8WbaWU,26905
2
+ flet/app.py,sha256=mAZZOTPwCatS2M_dCRnyCyvaRHpqY7quUOOQIlkL35U,27039
3
3
  flet/cli.py,sha256=IUM25fY_sqMtl0hlQGhlMQaBb1oNyO0VZeeBgRodhuA,204
4
4
  flet/data_channel.py,sha256=B1m_DT_jCRry8ebv5NLNySMG_BPRwdiisveYQX5HHvY,5429
5
5
  flet/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  flet/pytest_plugin.py,sha256=jjo8Hs7gjn22UCxNh9AGxOTQET9-wuhIXiYzQoofIKQ,5865
7
- flet/version.py,sha256=hcmuz0oe4X27lJ6WIvqeynCMZ11oxgWfMf4cLL558ZQ,4377
7
+ flet/version.py,sha256=w6LVRC6MnXBQLTWpZvwZjYZLM07z9fJuFqihAz2CmWw,4377
8
8
  flet/auth/__init__.py,sha256=8j9E6YuBwstGxwxWi1xKm0ZPkYBEU5SJzeriNsulQ1s,1608
9
9
  flet/auth/authorization.py,sha256=EBXt5dFe8mEi2c6PAsfoP7qdc-SDV6w1SzGXpEvUjac,1353
10
10
  flet/auth/authorization_service.py,sha256=akoDgthUrE0pf0XWWyNCtlBDttl1lfQ87Pt0gibLPTw,9701
@@ -51,7 +51,7 @@ flet/controls/buttons.py,sha256=q2oZK5wkmflPZJ-hsV46fYiZ4olGlaqoL1ng6Z8SPVU,1018
51
51
  flet/controls/client_action.py,sha256=-NV8FFiEn_zwHUhGf9Swj7W75n1xSTcH23S-wLRB58g,4380
52
52
  flet/controls/colors.py,sha256=tAGKLg5ngIgJuV8YkuspU1u2_bjaG4Kb_2ACsbRFEeg,15437
53
53
  flet/controls/context.py,sha256=FeCwAAwuEbkY1BGy5J0fPZG_xYfN89zOOZ7fR7TRvbQ,7840
54
- flet/controls/control.py,sha256=XrWA1EbSLchQOT08g6oJsVzSx8CpKbDc5UYAywOdNcQ,4216
54
+ flet/controls/control.py,sha256=OEt7TV7i779i3Up6z05gXTDnDKFMvegjlXuQei2o6eA,4216
55
55
  flet/controls/control_event.py,sha256=HXNKnPjenqdG8Mvxn2x6zlFNhz1cM1HYYnaiwPWCexA,4502
56
56
  flet/controls/control_state.py,sha256=hGG1gOsvQBsZJ9564s5HjlBvQQbRFo4a7pDx-6pmGUE,2884
57
57
  flet/controls/device_info.py,sha256=EVi40tVnwSZ9Fdh-xUWXlP6Bh7I5NaBlgfIkvgywN_A,25199
@@ -71,7 +71,7 @@ flet/controls/multi_view.py,sha256=1mjn9Vusg2kMiRF8UksYxb9joXSeJKEUW4LpFwrPXck,6
71
71
  flet/controls/object_patch.py,sha256=mPv5HE1VzCgtrDas_Y3hJG8n07iNJ1DfoGPF9p_mPhg,72614
72
72
  flet/controls/package_info.py,sha256=WDkUELz8wwyjUhuncXcgY2x1KcUWdOBEAPatWNoLvXY,4195
73
73
  flet/controls/padding.py,sha256=TjTudMD8FkHeOJnSX7v5nUHtcq9GNS12wY65wcW-EF0,1757
74
- flet/controls/page.py,sha256=npjomQb0ddNZZmcbS2x2Q5kl_5A2U0I1QPhafdMYS0Y,51378
74
+ flet/controls/page.py,sha256=tHpw-zCvVjalP8xu9TuRfYa4P_A_lYOV0JXpeH0JTnk,51505
75
75
  flet/controls/painting.py,sha256=urn3dNX_Sta9SMjIIxQJAQAF-qFS1MnundRaVCKNOAs,13975
76
76
  flet/controls/query_string.py,sha256=ZosheRtnbEaATPZIM9_UvsfyezK5rA8p7n0h663BGZ8,3301
77
77
  flet/controls/ref.py,sha256=FUN7XdvSHlQwLAg6so9EJjy0ZJ0zVP8eTf263hTRvU8,813
@@ -105,7 +105,7 @@ flet/controls/core/pagelet.py,sha256=04YlYPzVtidL92o5quAgoRtqUFyAUjEIX4y7YoDTD_I
105
105
  flet/controls/core/placeholder.py,sha256=YIHzZRKYYhRXfvtK_yUww0HXlp9Wac1gfuq3MYVeXyQ,1096
106
106
  flet/controls/core/raw_image.py,sha256=YAAbSgXDPz4lCsvd2UWOLgeF58re_eWmHto3yY4O8FU,19788
107
107
  flet/controls/core/reorderable_drag_handle.py,sha256=mAqI_NSLe-PWv2ukNNl5Aft_tHBjInn9vucM-lrHOiY,1558
108
- flet/controls/core/responsive_row.py,sha256=KQ5W0XfYe2OKb4GRlbPvFRaw88pv6OsuCSNGjLaXC0w,3902
108
+ flet/controls/core/responsive_row.py,sha256=JU8yQA5B8ufGu0hcSMN6INEliz2IPyTDd3U4XTM75FQ,5127
109
109
  flet/controls/core/rotated_box.py,sha256=snIl4nH_s9tJWYVcn0Hyiy9Ph5zMk4V5R0D_AlExius,872
110
110
  flet/controls/core/row.py,sha256=gFEn1DSMWDIhP0xiLTmP351dyZfKOFh3H_pm2u6tYi0,3166
111
111
  flet/controls/core/safe_area.py,sha256=ls6NdaVG5qi0T6re64gtslAfZgoWr9x7kC3HjGoFHdk,2183
@@ -208,7 +208,7 @@ flet/controls/material/progress_ring.py,sha256=NQvC7j4zKnkH5JutMQoJCPdonHbwbtQ6j
208
208
  flet/controls/material/radio.py,sha256=Wy8tgtiEWX4bu9pZfZFmJ55gsYH6EYuMS3Tqx2i8_z0,3033
209
209
  flet/controls/material/radio_group.py,sha256=lzemWm3nH6G_bt8jfdvx7qVLgot_nw2lumSjaNDoIt0,930
210
210
  flet/controls/material/range_slider.py,sha256=lk_OVHQJebZoUNmnir2N83R1eqiuQw6fBNMe6mmV7sQ,5180
211
- flet/controls/material/refresh_indicator.py,sha256=v8ncq2ZmTQLz5dmqYBHlCLhrTIFxVQh8tcYoktuntWk,5208
211
+ flet/controls/material/refresh_indicator.py,sha256=0ED5qFuEFaRFJT3iZsTKPJUrbVV-ngWD0RtcqG5iG8s,5588
212
212
  flet/controls/material/reorderable_list_view.py,sha256=muNq3wgZTwv5pyPmszauCaNEu4bvky_0vgBjUled7_4,5490
213
213
  flet/controls/material/search_bar.py,sha256=wxOzoI4mzD5wWRtOwHjJTDLLhflqx026sk-rBgiOGvg,9422
214
214
  flet/controls/material/segmented_button.py,sha256=LnJQqLBnR1PSyM_d13UyLBT64sASp26DZGQsl5eReS8,5685
@@ -242,7 +242,7 @@ flet/controls/services/shake_detector.py,sha256=A9o5Z89lBUL7j6OhhMWv3Qna2O_ke1h3
242
242
  flet/controls/services/share.py,sha256=oVx9_UUC-PL6WGg2zvrVdp3XMQFVhVlwtaIqJP8-xqM,11092
243
243
  flet/controls/services/shared_preferences.py,sha256=dMaHvjViZt39CdvKvjuQutci3joAKiJyncLQDBzaRyw,3326
244
244
  flet/controls/services/storage_paths.py,sha256=6ZS8Z9FYtaTC9_Ap35ZDoFaCfU_neHBZCCvNmozNJ5I,8363
245
- flet/controls/services/url_launcher.py,sha256=dY_1NPDDjM9Wm2b_nii9-uVZZUjIDrXmWl3Ho8npdEw,6726
245
+ flet/controls/services/url_launcher.py,sha256=FiNUDYwtyPih7DjEuiUUWxPUITfPb7nSYUU2S_7uhhw,6900
246
246
  flet/controls/services/user_accelerometer.py,sha256=W9DobNpj4NiLT08RdaJ9Vn9xiVA6EsPE16eb2C9Akpc,3022
247
247
  flet/controls/services/wakelock.py,sha256=tBYazrGtM0InCK7oNLEB0ePu3zVoQYELFUVpGXVL27U,693
248
248
  flet/fastapi/__init__.py,sha256=hwHJQOc-QoaTwNbmQTza-VfUqWFFn2EVnlsErG7b8Lk,489
@@ -277,15 +277,15 @@ flet/utils/locks.py,sha256=ZwRmMwijFLidaBJXlH1dbZre6Gtsn893xV3qv6EAXxY,605
277
277
  flet/utils/network.py,sha256=168Qh_Oy77PtcMoP1-eV5pvoVUeV0qiwi_ZMa6Yb2w4,943
278
278
  flet/utils/object_model.py,sha256=WcCaitrYUetP-622cQd2O6chzruOCfI7UG46ioXE1tI,4787
279
279
  flet/utils/once.py,sha256=SSq7lbLxFPm_QxSoLZ4qog-0nLMhj0l4mQbPrR6oU50,1036
280
- flet/utils/pip.py,sha256=LxlLP7vbOxQWDdxx9BjjyYeFIyOu167s2Dw_XpMUUso,4056
280
+ flet/utils/pip.py,sha256=bT85ad6VZHD5b4J_PkAl5qeb7FRt6Z9pis951K9y8C4,4417
281
281
  flet/utils/platform_utils.py,sha256=yNFW2yC4HajI8KDFFuxdg0XbaRzXcue623WXBb7oclc,4911
282
282
  flet/utils/slugify.py,sha256=SJMNUMcwuAUbHDDmggPz7Dvk7H4BiiPV-oR0xtEbYJk,468
283
283
  flet/utils/strings.py,sha256=LJBd9R7GvhCyvOCUA3SId_nwMsiXeDNe49Su5BaT2No,388
284
284
  flet/utils/typing_utils.py,sha256=asp2wpBNNWH8kSxAzI2hvnpyKIgwXqGen27VmKcTUt0,989
285
285
  flet/utils/validation.py,sha256=qdO9EcebAu1cGv8QVR1AsDdtQn16xVFtcwjn0599Hng,60933
286
286
  flet/utils/vector.py,sha256=nKDWoA-WhdRsg0kKn2b4kKeDkSLxWAhdVnXjPPwzMXI,5163
287
- flet-1.1.0.dev3.dist-info/METADATA,sha256=IRjzG-xXjMRyOmoMGk4Xb2dAoJMCi-SbEDcBrW2ADO0,7579
288
- flet-1.1.0.dev3.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
289
- flet-1.1.0.dev3.dist-info/entry_points.txt,sha256=BcV9ss1uxSZLYpcRblgEcbSP6ib7zCi_PUQCmfUG7rA,77
290
- flet-1.1.0.dev3.dist-info/top_level.txt,sha256=HbLrSnWJX2jZOEZAI14cGzW8Q5BbOGTtE-7knD5FDh0,5
291
- flet-1.1.0.dev3.dist-info/RECORD,,
287
+ flet-1.1.0.dev4.dist-info/METADATA,sha256=D0tMEXo0TONRUc0AGgQmIj3Dt8S32u5dzGnRsKczJLo,7579
288
+ flet-1.1.0.dev4.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
289
+ flet-1.1.0.dev4.dist-info/entry_points.txt,sha256=BcV9ss1uxSZLYpcRblgEcbSP6ib7zCi_PUQCmfUG7rA,77
290
+ flet-1.1.0.dev4.dist-info/top_level.txt,sha256=HbLrSnWJX2jZOEZAI14cGzW8Q5BbOGTtE-7knD5FDh0,5
291
+ flet-1.1.0.dev4.dist-info/RECORD,,