Commit f466bdd
authored
New services:
* Add sensor services and events to Flet
Introduced support for device sensors including accelerometer, user accelerometer, gyroscope, magnetometer, and barometer. Added corresponding Dart services, Python control classes, event types, and documentation. Updated mkdocs navigation and provided example usage for each sensor.
* Refactor sensors service imports and formatting
Added import for numbers utility in sensors.dart and improved code formatting for error handling and debug print statements.
* Update PyPI cleanup script and add module support
Changed the version exclusion regex and added cleanup commands for multiple flet modules to the clean-pypi.sh script to ensure all related packages are properly cleaned from PyPI.
* Update sensors_plus to version 7.0.0
Bump sensors_plus dependency from 6.1.1 to 7.0.0 in pubspec.yaml and update pubspec.lock accordingly for compatibility with the latest package features and fixes.
* Add services property to BasePage and View
Introduces a services property to BasePage and View, allowing management of Service controls via property accessors. The services attribute is now stored in View and proxied through BasePage, improving encapsulation and flexibility.
* Refactor sensor examples and update service docs
Sensor example scripts now use `page.services` and `page.controls` instead of session store and `page.add`. Documentation for sensor services was updated for clarity, platform support, and iOS requirements, including details on `NSMotionUsageDescription` for barometer usage.
* Fix and clarify docstrings and references in controls
Corrected docstring references and improved clarity in several control modules. Updated links to use correct attribute names and fixed formatting in flet_map/types.py, cupertino_switch.py, snack_bar.py, and types.py.
* Add ScreenBrightness service and Python bindings
Introduces ScreenBrightnessService in Dart and ScreenBrightness control in Python, enabling control and observation of system and application screen brightness. Updates plugin registrants for macOS and Windows, adds documentation and example usage, and includes the screen_brightness dependency in pubspec.yaml.
* 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.
* Add Wakelock service to Flutter and Python SDKs
Introduced a new Wakelock service to prevent device sleep in both the Flutter and Python Flet SDKs. Added the wakelock_plus dependency to the Flutter project, implemented the WakelockService in Dart, and exposed the Wakelock control in Python with documentation and an example. Updated documentation and navigation to include the new control.
* Update package_info_plus and wakelock_plus dependencies
Bump package_info_plus to version 9.0.0 in client with an override, and update wakelock_plus to 1.4.0 in both client and flet package. This ensures compatibility with the latest versions and resolves potential dependency conflicts.
* Update wakelock_plus and add new dependencies
Downgraded wakelock_plus to v1.2.8 in packages/flet and added wakelock_plus v1.4.0 and package_info_plus v9.0.0 to client dependencies. This ensures compatibility and provides additional functionality in the client package.
* Add Battery service support to Flet
Introduces Battery service integration in Flet, including Dart and Python implementations, documentation, and example usage. Updates plugin registrants for macOS and Windows, adds battery_plus dependency, and exposes Battery-related types and events in the Python SDK.
* Add connectivity service and documentation
Introduced Connectivity service in both Dart and Python SDKs, enabling connectivity status checks and change notifications. Registered connectivity_plus plugin for macOS and Windows clients, updated dependencies, and added example usage and documentation for the new service.
* Add and improve docstrings for service controls
Added and enhanced docstrings for classes and methods in battery, browser_context_menu, clipboard, connectivity, service, shared_preferences, storage_paths, and url_launcher modules to improve code documentation and clarity for developers.
* Add Share service and Python API for sharing
Introduces ShareService in Dart and integrates share_plus for sharing text, links, and files. Adds Python API (Share, ShareFile, ShareResult, etc.), documentation, and example usage. Updates plugin registration and dependencies for macOS and Windows.
* Rename CupertinoActivityType to ShareCupertinoActivityType
Replaces the CupertinoActivityType enum with ShareCupertinoActivityType throughout the codebase for clarity and consistency. Updates documentation, mkdocs navigation, and references in __init__.py and share.py. Adds docstrings and improves type annotations for share-related classes and methods.
* Refactor docs: move service-related files and update navigation
Service-related documentation files were moved from 'controls' and 'types' to a new 'services' directory. The mkdocs navigation was updated to reflect this change, grouping all service docs under a new 'Services' section. Macros and overview rendering were refactored to support both controls and services navigation. Minor cleanup in page.dart and macro Python files.
* Add API Reference and Types docs, update nav structure
Introduces new API Reference and Types index documentation pages. Updates mkdocs.yml to include these sections in the navigation, providing better structure and discoverability for API and type documentation. Minor wording improvements in the cookbook index.
* Add cookbook overview macro and generalize nav rendering
Introduced a new `cookbook_overview` macro for generating a dynamic overview list in the cookbook docs. Refactored and generalized the navigation rendering logic in `controls_overview.py` to support arbitrary nav paths, base directories, and skip paths, enabling reuse for different documentation sections. Updated the cookbook index to use the new macro and improved the API reference and cookbook index content.
* Move examples from controls to services directory
Renamed Python example files and related media from sdk/python/examples/controls to sdk/python/examples/services for consistency. Updated references in documentation and README files to point to the new services paths. Adjusted code comments and doc macros to reflect the new structure.
* Add basic examples and update docs for services
Added basic usage examples for BrowserContextMenu, Clipboard, SharedPreferences, and StoragePaths services in the examples directory. Updated corresponding documentation files to include example code and improved structure for better clarity.
* Enhance UrlLauncher with launch modes and configuration
Added support for multiple launch modes, in-app web view and browser view configurations, and popup window opening in UrlLauncher for both Dart and Python SDKs. Updated documentation and examples to reflect new features and usage. Exposed BrowserConfiguration, LaunchMode, and WebViewConfiguration in Python package exports and docs.
* Refactor service registry usage in Page control
Consolidated service registries in the Page control by removing separate _user_services and _page_services in favor of a single _services property. Updated related Dart and Python code, including tests and service registration logic, to reflect this change. Deprecated direct service properties on Page in favor of using service classes directly.
* Update commented key from _user_services to _services
Changed a commented dictionary key in test_object_diff_in_place.py from '_user_services' to '_services' for consistency with the underlying code or data structure.
* Update Flutter dependencies to latest versions
Upgraded battery_plus to 7.0.0, connectivity_plus to 7.0.0, device_info_plus to 12.3.0, and screen_brightness to 2.1.7 in packages/flet/pubspec.yaml. This ensures compatibility with the latest features and bug fixes from these packages.
* Add file sharing from path example
Introduces a new function to share files from a file path, including UI updates to provide separate buttons for sharing files from bytes and from paths. File sharing from paths is disabled on the web platform.
* Set pixel_ratio in outlined button screenshot tests
Updated screenshot assertions in the handling_clicks test to specify the pixel_ratio parameter, ensuring screenshots are taken with the correct scaling.
* Remove duplicate and redundant code in Flet package
Eliminated a duplicate line in the ShareFile documentation, removed a repeated entry for 'BrowserConfiguration' in __all__, and simplified the ServiceRegistry default_factory in Page control. These changes improve code clarity and maintainability.
* Refactor sensor services and event models
Split sensor services into individual Dart files and refactor base class for sensor streams. In Python, move sensor event models into their respective service modules, update event timestamp types to datetime, and remove the shared sensor_events.py file. Update imports and public API accordingly for improved modularity and clarity.
* Refactor sensor example apps to use page.add and append
Updated sensor service example scripts to use page.add for UI controls and page.services.append for service registration, replacing previous usage of page.controls and assignment to page.services. Also removed unnecessary variable declarations and logging setup for improved clarity and consistency.
* Refactor connectivity API and add platform checks
Renamed connectivity methods and event handlers for consistency (e.g., 'check_connectivity' to 'get_connectivity', 'on_connectivity_change' to 'on_change'). Updated enum name from ConnectivityResult to ConnectivityType. Added platform support checks to sensor and service classes, raising FletUnsupportedPlatformException on unsupported platforms. Improved documentation to clarify supported platforms for each service.
* Replace ConnectivityResult with ConnectivityType in docs
Removed the documentation for ConnectivityResult and added documentation for ConnectivityType. Updated mkdocs.yml navigation to reference ConnectivityType instead of ConnectivityResult.Accelerometer, Barometer, Battery, Connectivity, Gyroscope, Magnetometer, Share, ScreenBrightness, UserAccelerometer, Wakelock (#5846)1 parent 2977e1a commit f466bdd
File tree
135 files changed
+3595
-301
lines changed- .github/scripts
- client
- macos/Flutter
- windows/flutter
- packages/flet
- lib/src
- controls
- services
- transport
- utils
- sdk/python
- examples/services
- accelerometer
- audio_recorder
- audio
- barometer
- battery
- clipboard
- connectivity
- file_picker
- media
- flashlight
- geolocator
- gyroscope
- haptic_feedback
- magnetometer
- permission_handler
- screen_brightness
- semantics_service
- shake_detector
- storagepaths
- urllauncher
- user_accelerometer
- wakelock
- packages
- flet-audio-recorder
- flet-audio
- flet-flashlight
- flet-geolocator
- flet-map/src/flet_map
- flet-permission-handler
- flet
- docs
- api-reference
- audio_recorder
- audio
- cookbook
- extras/macros
- flashlight
- geolocator
- permission_handler
- services
- types
- integration_tests/examples/material
- src/flet
- controls
- core
- cupertino
- material
- services
- messaging
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
135 files changed
+3595
-301
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
| 44 | + | |
38 | 45 | | |
| 46 | + | |
39 | 47 | | |
40 | 48 | | |
41 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
84 | 100 | | |
85 | 101 | | |
86 | 102 | | |
| |||
129 | 145 | | |
130 | 146 | | |
131 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
132 | 164 | | |
133 | 165 | | |
134 | 166 | | |
| |||
766 | 798 | | |
767 | 799 | | |
768 | 800 | | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
769 | 809 | | |
770 | 810 | | |
771 | 811 | | |
| |||
782 | 822 | | |
783 | 823 | | |
784 | 824 | | |
785 | | - | |
| 825 | + | |
786 | 826 | | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
787 | 835 | | |
788 | 836 | | |
789 | | - | |
| 837 | + | |
790 | 838 | | |
791 | 839 | | |
792 | | - | |
| 840 | + | |
793 | 841 | | |
794 | 842 | | |
795 | 843 | | |
| |||
1054 | 1102 | | |
1055 | 1103 | | |
1056 | 1104 | | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
1057 | 1113 | | |
1058 | 1114 | | |
1059 | 1115 | | |
| |||
1062 | 1118 | | |
1063 | 1119 | | |
1064 | 1120 | | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1065 | 1145 | | |
1066 | 1146 | | |
1067 | 1147 | | |
| |||
1070 | 1150 | | |
1071 | 1151 | | |
1072 | 1152 | | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
1073 | 1161 | | |
1074 | 1162 | | |
1075 | 1163 | | |
| |||
1122 | 1210 | | |
1123 | 1211 | | |
1124 | 1212 | | |
1125 | | - | |
| 1213 | + | |
1126 | 1214 | | |
1127 | 1215 | | |
1128 | | - | |
| 1216 | + | |
1129 | 1217 | | |
1130 | 1218 | | |
1131 | 1219 | | |
| |||
1134 | 1222 | | |
1135 | 1223 | | |
1136 | 1224 | | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
1137 | 1241 | | |
1138 | 1242 | | |
1139 | 1243 | | |
| |||
1299 | 1403 | | |
1300 | 1404 | | |
1301 | 1405 | | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
1302 | 1414 | | |
1303 | 1415 | | |
1304 | 1416 | | |
| |||
1428 | 1540 | | |
1429 | 1541 | | |
1430 | 1542 | | |
1431 | | - | |
| 1543 | + | |
1432 | 1544 | | |
1433 | 1545 | | |
1434 | | - | |
| 1546 | + | |
1435 | 1547 | | |
1436 | 1548 | | |
1437 | | - | |
| 1549 | + | |
1438 | 1550 | | |
1439 | 1551 | | |
1440 | 1552 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | | - | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| 18 | + | |
16 | 19 | | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
| |||
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
| 45 | + | |
| 46 | + | |
37 | 47 | | |
38 | 48 | | |
| 49 | + | |
| 50 | + | |
39 | 51 | | |
40 | 52 | | |
41 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
13 | 16 | | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
0 commit comments