Skip to content

Commit 36fb660

Browse files
committed
Update screen brightness docs and clarify platform support
Fixed example path in ScreenBrightness docs, added documentation for ScreenBrightnessChangeEvent, and updated mkdocs navigation. Clarified that accelerometer, gyroscope, and user accelerometer services are only supported on Android and iOS (not web). Expanded ScreenBrightness docstring with platform notes and Android permission instructions.
1 parent 25787b1 commit 36fb660

File tree

7 files changed

+23
-5
lines changed

7 files changed

+23
-5
lines changed

sdk/python/packages/flet/docs/controls/screenbrightness.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
class_name: flet.ScreenBrightness
3-
examples: ../../../../examples/controls/screen_brightness
3+
examples: ../../examples/controls/screen_brightness
44
---
55

66
{{ class_summary(class_name) }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ class_all_options("flet.ScreenBrightnessChangeEvent") }}

sdk/python/packages/flet/mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,10 @@ nav:
441441
- Semantics: controls/semantics.md
442442
- SemanticsService: controls/semanticsservice.md
443443
- ScreenBrightness: controls/screenbrightness.md
444+
- Screenshot: controls/screenshot.md
444445
- ShaderMask: controls/shadermask.md
445446
- Shimmer: controls/shimmer.md
446447
- ShakeDetector: controls/shakedetector.md
447-
- Screenshot: controls/screenshot.md
448448
- Slider: controls/slider.md
449449
- SnackBar: controls/snackbar.md
450450
- Stack: controls/stack.md
@@ -890,6 +890,7 @@ nav:
890890
- ScaleEndEvent: types/scaleendevent.md
891891
- ScaleStartEvent: types/scalestartevent.md
892892
- ScaleUpdateEvent: types/scaleupdateevent.md
893+
- ScreenBrightnessChangeEvent: types/screenbrightnesschangeevent.md
893894
- ScrollEvent: types/scrollevent.md
894895
- TabBarHoverEvent: types/tabbarhoverevent.md
895896
- TapEvent: types/tapevent.md

sdk/python/packages/flet/src/flet/controls/services/accelerometer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Accelerometer(Service):
3333
Accelerometer reports zero acceleration if the device is free falling.
3434
3535
Note:
36-
* Supported platforms: Android, iOS, web.
36+
* Supported platforms: Android, iOS.
3737
* Web ignores requested sampling intervals.
3838
"""
3939

sdk/python/packages/flet/src/flet/controls/services/gyroscope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Gyroscope(Service):
1919
reporting device rotation rate around each axis in `rad/s`.
2020
2121
Note:
22-
* Supported platforms: Android, iOS, web.
22+
* Supported platforms: Android, iOS.
2323
* Web ignores requested sampling intervals.
2424
"""
2525

sdk/python/packages/flet/src/flet/controls/services/screen_brightness.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,28 @@
1212
@dataclass
1313
class ScreenBrightnessChangeEvent(Event["ScreenBrightness"]):
1414
brightness: float
15+
"""
16+
The new screen brightness, in range `0.0..1.0`.
17+
"""
1518

1619

1720
@control("ScreenBrightness")
1821
class ScreenBrightness(Service):
1922
"""
2023
Provides access to control and observe system and application screen brightness.
24+
25+
Note:
26+
* Supported platforms: Android, iOS.
27+
28+
/// admonition | Running on Android
29+
type: warning
30+
To adjust the system brightness on Android, add the following permission
31+
in your `pyproject.toml` file:
32+
```toml
33+
[tool.flet.android.permission]
34+
"android.permission.WRITE_SETTINGS" = true
35+
```
36+
///
2137
"""
2238

2339
on_system_screen_brightness_change: Optional[

sdk/python/packages/flet/src/flet/controls/services/user_accelerometer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class UserAccelerometer(Service):
2626
from [`AccelerometerReadingEvent`][flet.].
2727
2828
Note:
29-
* Supported platforms: Android, iOS, web.
29+
* Supported platforms: Android, iOS.
3030
* Web ignores requested sampling intervals.
3131
"""
3232

0 commit comments

Comments
 (0)