Skip to content

Flet v1 #5382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 620 commits into
base: main
Choose a base branch
from
Open

Flet v1 #5382

wants to merge 620 commits into from

Conversation

FeodorFitsner
Copy link
Contributor

No description provided.

FeodorFitsner and others added 23 commits April 25, 2025 17:57
* MatplotlibChart and PlotlyChart controls

* Fixed ResponsiveRow
…ontainer (#5246)

* init commit

* merge 'v1' into 'v1-services'

* cleanup
* Removed sync methods

* Page register fix

* OAuth - draft, tested on GitHub

* Some cleanup

* Update poetry.lock

* Fix [tool.poetry] package-mode = false
* poetry replaced with uv

* Try building with CI

* add uv to path

* Fix sdk path

* Support for desktop light

* unpack pyodide

* Update contributing guide

* Enable Ruff
* bring back page.open() and page.close(), as deprecated

* fix dropdownm2

* create events.py

* Cupertino*Actions: rename `is_default_action` to `default` and `is_destructive_action` to `destructive`

* Cupertino*Actions: rename `is_default_action` to `default` and `is_destructive_action` to `destructive`

* improve ListTile material transparency

* dont wrap TextFields in LayoutBuilder

attempts to fix a bug that occured in below code:
```py
ft.AlertDialog(
    adaptive=True,
    content=ft.Column(
        controls=[
            ft.TextField(),
            ft.TextField(),
        ],
    )
)
```

* main.dart minor update

* Fix `InteractiveViewer.on_interaction_end`‘s typing
…et run` and `flet publish` (#5257)

* Include replaced controls to remove_controls

* Add --no-cdn and --no-wasm options to CLI

* Update pyproject_toml.py

* SafeArea conflicting props renaming

* AuthorizationService and stub for Pyodide

* Slider value is optional

* Fix Slider assertions

* fixed Gradient bug

* OutlinedButton: deleted `text` property

* --no-cdn finished

* Fix web job

* Fixed getWidgetStateProperty()

* Another fix of getWidgetStateProperty()

---------

Co-authored-by: InesaFitsner <inesa@appveyor.com>
* Add flet_audio, flet_video extensions to Flet Client

* Build macOS on Sonoma
* Checkbox issue fixed

* Chip.selected fixed
* permit `Overlay` controls to use `Positioned` for absolute positioning

* `ShaderMask.blend_mode` default value

* new: `ResponsiveRow.breakpoints` (user-defined-breakpoints: #2944)

* refactor `StoragePaths` to use methods instead of props

* fix `CupertinoTimerPicker`

* fix `OutlinedButton`

* fix `SearchBar`

* fix `AutoComplete`

* change typing of ref in `BaseControl`

* fix `AutoComplete`: make selection_index part of AutoCompleteSelectEvent

* reformat code
…5274)

* Add flet_audio, flet_video extensions to Flet Client

* Multi-view draft

* MultiView - more code!

* Before Page split

* Page split into Page and PageView

* Do not re-add multi-views

* FletApp.multiView

* Multi-view - almost done

* Flet web settings are all in JavaScript

* use_color_emoji has gone

* Fix tests

* Fix test again

* page.on_close is back

* Cleanup, typing

* FilePicker and uploads

* Image.src_bytes, DecorationBox.src_bytes

* Fix Map<String, dynamic> everywhere

* Fix object patcher: ignore "data" fields

* Added key to all stateful control widgets

* Fix desktop lagginess of CupertinoPicker

* Fixed DragTarget

* DragTarget improved/simplified

Breaking changes: DragTarget.on_will_accept is of `DragWillAcceptEvent` type with `accept: bool` field. Use `e.accept` instead of `e.data`. DragTarget.on_leave is of `DragTargetLeaveEvent` type with `src_id` field. Use `e.src_id` instead of `e.data`.

* Fix ResponsiveRow

* Autocomplete.selected_index

* revert __init__.py - before

* Fix multiple __init__.py

* Add missing to __all__

* FilePicker method typings

* Fix typings and defaults in serve_fastapi_web_app.py
* Docstrings and default values for IconButton

* remove ListTile example

* docstrings for ListTile

* ListTile, MenuBar

* MenuItemButton

* NavigationBar

* NavigationDrawer

* Delete a.txt
* removed example

* NavigationRailDestination

* NavigationRail

* removed example

* Update outlined_button.py

* PopupMenuButton docstrings and removed text property

* ProgressBar docstrings

* deleted example

* ProgressRing properties

* removed example

* RadioGroup docstrings

* removed example

* Radio docstrings

* asserts for RangeSlider

* RangeSlider docstrings

* Control docstring

* ReorderableListView docstrings

* SearchBar Control docstrings

* SearchBar docstrings

* formatted for ruf

* asserts for SegmentedButton

* SegmentedButton docstrings

* SelectionArea docstrings

* removed example

* Slider docstrings

* removed example

* SnackBar docstrings

* SubmenuButton docstrings

* Switch docstrings

* Tab docstrings, fixed SegmentedButton

* Tab docstrings

* TextButton description

* TextButton docstrings

* InputFilter docstrings

* TextField description

* TextField docstrings

* FormFieldControl docstrings

* TimePicker description

* TimePicker docstrings

* Tooltip description

* Tooltip docstrings

* TextField docstrings

* VerticalDivider docstrings

* AlertDialog docstrings formatting

* docstrings for all Material Controls formatted
* docstrings

* CupertinoActionSheet docstrings and types

* docstrings

* docstrings

* docstrings

* docstrings

* docstrings

* CupertinoCheckbox description

* docstrings

* Update cupertino_colors.py

* docstrings

* docstrings

* formatting for ruf

* docstrings

* Update cupertino_filled_button.py

* Control description

* docstrings and types

* CupertinoDialogAction description

* Update cupertino_list_tile.py

* docstrings

* Update cupertino_navigation_bar.py

* docstrings

* Update cupertino_picker.py

* docstrings

* docstrings

* docstrings

* Control description

* docstrings

* Update cupertino_sliding_segmented_button.py

* docstrings

* Update cupertino_switch.py

* docstrings

* docstrings

* docstrings

* Update cupertino_tinted_button.py
* removed example from description

* AlertDialog properties docstrings

* AnimatedSwitcher description

* AnimatedSwitcher properties docstrings

* AutofillGroup properties docstrings

* Column description

* Column properies docstrings

* Dismissible description

* Dismissible properties docstrings

* DragTarget properties docstrings

* Draggable description

* Draggable properties docstrings

* FletApp properties docstrings

* GestureDetector description

* GestureDetector properties docstrings

* GridView description

* GridView and ScrollableControl properties

* Icon docstrings

* Image description

* Image properties docstrings

* InteractiveViewer description

* InteractiveViewer properties docstrings

* ListView description

* ListView properties docstrings

* Markdown description

* Markdown properties docstrings

* MatplotlibChart description

* MatplotlibChart properties docstrings

* MergeSemantics docstrings

* Pagelet docstrings

* Placeholder docstrings

* Update plotly_chart.py

* ResponsiveRow description

* ResponsiveRow properties docstrings

* Row description

* Row properties docstrings

* SafeArea description

* SafeArea properties docstrings

* Semantics description

* Semantics properties docstrings

* ShaderMask description

* ShaderMask properties docstrings

* Stack description

* Stack properties docstrings

* TextSpan properties

* TextAffinity Enum docstrings

* TextSelection and TextSelectionChangeCause

* Update text.py

* Text properties docstrings

* Update text.py

* TransparentPointer docstrings

* View description

* View properties docstrings

* WindowDragArea description

* Window properties docstrings
* ShakeDetector description

* ShakeDetector properties docstrings

* HapticFeedback methods docstrings

* HapticFeedback async methods docstrings

* SemanticsService methods docstrings

* SemanticsService async methods docstrings

* FilePicker methods docstrings

* FilePickerFile properties docstrings

* FilePickerFileType values docstrings

* FilePickerUploadEvent doctrings
* Canvas docstrings

* CanvasResizeEvent docstrings

* Arc docstrings

* Circle shape docstrings

* Color shape docstrings

* Fill shape docstrings

* Line shape docstrings

* Oval shape docstrings

* Path shape docstrings

* Points shape dosctrings

* Rect shape docstrings

* Shadow shape docstrings

* Text shape docstrings

* removed List from types

* BarChart docstrings

* BarChartEvent docstrings

* BarChart docstrings

* BarChartRod docstrings

* ChartAxis docstrings

* ChartAxisLabel docstrings

* Chart docstrings

* ChartSquarePoint, ChartCrossPoint

* ChartCirclePoint docstrings

* LineChart docstrings

* LineChartData, LineChartDataPoint

* LineChartEvent, LineChartEventSpot

* PieChartSection docstrings

* Update pie_chart_section.py

* PieChartEvent docstrings

* PieChart docstrings

* ScatterChart docstrings - TBD

* AdaptiveControl

* Alignment docstrings

* Animation

* AnimationStyle

* Blur docstrings

* BorderRadius docstrings

* Border class and image for Container docstrings

* Border docstrings
* BoxShadow

* FilterQuality

* ColorFilter

* DecorationImage

* BoxDecoration

* BoxConstraints

* Description of BoxConstraints

* ButtonStyle

* Update colors.py

* Control properties docstrings

* BaseControl, ConstraintControl, Control

* ConstrainedControl docstrings

* Control docstrings

* DialogControl properties

* Duration and Gradient docstrings

* Gradient: changed type default value

type not to show up in pop-up hints or autocomplete suggestions when initializing Gradient

* Gradients docstrings

* GradientTileMode docstrings

* Margin docstrings

* col property

* Padding docstrings

* Page description

* Page properties docstrings

* PageView, Page, Clipboard

* Update page_view.py

* Paint doctsrings

* Update painting.py

* PaintLinearGradient docstrings

* PaintRadialGradient docstrings

* PaintSweepGradient

* scroll_to docstrings

* TextStyle docstrings

* StrutStyle docstrings

* TextDecorationStyle Enum

* TextDecoration

* Update text_style.py

* Update theme.py

* AppBarTheme docstrings

* ColorScheme docstrings

* ColorScheme
* Bump Flutter to 3.32.0

* CI: FLUTTER_VERSION: 3.32.0

* `@data_view` decorator

* OptionalControlStateValue > Optional[ControlStateValue]

* Compare "frozen" dataclasses

* data view lists comparison

* Fixed in-place collection comparison. added tests.

* Center control

* ControlBuilder control

* Simple event handlers can now omit `e` parameter

* Fixed event handlers comparison for frozen controls

* Tests for nested ControlBuilders

* Squashed commit of the following:

commit 345d6ee
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Sat Jun 7 17:46:06 2025 -0700

    Flutter 3.32.2

commit 91e657b
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Sat Jun 7 12:49:34 2025 -0700

    Object patcher fixes. Navigation controls fixed.

commit bc3f289
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Fri Jun 6 11:37:53 2025 -0700

    OptionalEventCallable allow handlers with `e` arg and without

commit eec74c1
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Fri Jun 6 11:30:41 2025 -0700

    Fix dart tests

commit 4e33aa0
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Fri Jun 6 11:15:40 2025 -0700

    Remove Center control

commit f00506a
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Fri Jun 6 11:00:32 2025 -0700

    One more test and cleanup

commit 2f0e3ba
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Fri Jun 6 10:55:44 2025 -0700

    All python tests are passing

commit 3aede43
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Thu Jun 5 17:08:15 2025 -0700

    Fix mount/unmount for frozen controls

commit f4d14a0
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Thu Jun 5 14:05:43 2025 -0700

    NEW Control.update and Control.applyPatch methods

commit decc499
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Thu Jun 5 09:40:01 2025 -0700

    Python part done

commit 796f4c4
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Thu Jun 5 08:53:14 2025 -0700

    operation path is always two elements

commit 96b1fb4
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Wed Jun 4 19:55:20 2025 -0700

    Frozen tests passing

* Pyodide 0.27.7

* Skip fields are comparable

* ft.context.page works in all event handlers

* Added cache to ControlBuilder

* `list_key` and `scroll_key` migrated to a unified `key`

* Fixed method calls for frozen controls

* Strongly-typed events and event handlers

* update and auto-update fixed for frozen controls
* initial commit

* bump window_manager to 0.5.0

* Update window_drag_area.dart
* Update Ref to support initialization and assign optional value

* Simplify constructor

---------

Co-authored-by: Feodor Fitsner <feodor@appveyor.com>
* Update window.py

* EventHandler and ControlEventHandler

* Changed OptionalControlEventCallable to ControlEventHandler

* OptionalControlEventCallable changed to ControlEventHandler

* OptionalControlEventCallable

* Define type for OnScrollEvent

* TapEvent migrated

* OptionalControlEventCallable changed to ControlEventHandler

* OptionalControlEventCallable changed to ControlEventHandler

* Update datatable.py

* Update pubspec.lock

* Replaced OptionalControlEventCallable with ControlEventHandler

* Dismissible and Page

* Fixed Page events

* GestureDetector, DragTarget

* Update events.py

* Fixed creation of event types with ForwardRef

* Update events.py

* Update interactive_viewer.py

* Add `OptionalEventHandler` and `OptionalControlEventHandler`

* Markdown events

* Update text.py

* Update text.py

* WindowDragArea

* Update window_drag_area.py

* BarChart

* DatePicker and AutoComplete

* TimePicker, FilePicker

---------

Co-authored-by: Feodor Fitsner <feodor@appveyor.com>
* ScrollableControl.reverse moved to GridView, ListView and ReorderableListView

* Fix PlotlyChart with kw_only=True

* Fixed CupertinoSlider.on_change_start/_end

* Fixed ReorderableListView. Reorder logic moved to Python.

* Fixed GestureDetector.on_long_press_start

* Fix ReorderableListView flickering on reorder

* Some cherry-picking from Flet v0

* Page.view_pop, View.can_pop, View.on_confirm_pop

* DropdownOption: change class to alias

* Fix FilePicker for macOS

* Add `src_id` to `DragWillAcceptEvent` event

* Fix page/user services init

* Flutter 3.32.4

* Add `src_bytes` argument to `FilePicker.save_file()`

* Update view.py

* uv.lock updated

* Dependencies cleanup
* Lottie

* create `utils/geometry.dart` with `Rect` and `Size`

* add flet-rive to client

* uncomment flet-rive in pubspec.yaml

* fix missing colors

* fix imports

* add flet-map pubspec.yaml

* add flet-map to main.dart

* add flet-webview to client

* more docs

* remove Duration.from_datetime

* document border utils | BorderStyle

* document border-radius utils

* flet-audio-recorder package

* add permission-handler

* edit Podfile to include permission macros

* snackbar action

* add flet_geolocator to client

* add flet-flashlight to client

* flet-ads in client

* add Tooltip.decoration prop

* add flet-datatable2 to client

* comment out webview_flutter_android override

* improve TextSpan

* create StringExtension (trim* methods)

* introduce `BaseControl._internal`

* ConstrainedControl based on BaseControl

* dart: remove chart controls

* python: remove chart controls

* add flet-charts to client

* Fixed LineChart tests

* dart: `control.internals` | skip badge on-demand

* `control.internals` of type `Map<String, dynamic>?

* Bump Flutter dependencies

* Suppress websockets and uvicorn warnings in dev mode

* Install libasound2-dev on Linux

* make `EventControlType` globally available | remove `OptionalEventCallable`

* fix tests | revert OptionalControlEventHandler

* fix test_events.py

---------

Co-authored-by: Feodor Fitsner <feodor@appveyor.com>
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request #5382 has too many files changed.

We can only review pull requests with up to 300 changed files, and this pull request has 831.

commit 2a1facb
Author: Henning Wilmer <57907680+HenningCode@users.noreply.github.com>
Date:   Thu Jun 12 18:37:58 2025 +0200

    Change the type alias from a class to a real rename (#5258)

commit 8f83b45
Author: PythonPan <2292551082@qq.com>
Date:   Fri Jun 13 00:29:49 2025 +0800

    Fix  page.run_thread does not receive kwargs (#5318) (#5320)

commit bf09a2c
Author: Antón Fernández Pérez <134967595+SIRGPrice@users.noreply.github.com>
Date:   Wed Jun 11 21:16:41 2025 +0200

    Update remove_control_payload.dart (#5353)

    Android apk app randomly generates this error in logcat:

    E  [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: type 'Null' is not a subtype of type 'String'
                                                                                                        #0      new List.from (dart:core-patch/array_patch.dart:30)
                                                                                                        #1      new RemoveControlPayload.fromJson (package:flet/src/protocol/remove_control_payload.dart:7)
                                                                                                        #2      appReducer (package:flet/src/reducers.dart:376)
                                                                                                        #3      Store._createReduceAndNotify.<anonymous closure> (package:redux/src/store.dart:235)
                                                                                                        #4      Store.dispatch (package:redux/src/store.dart:267)
                                                                                                        #5      FletServer._onMessage (package:flet/src/flet_server.dart:265)
                                                                                                        #6      FletTcpSocketServerProtocol._onMessage (package:flet/src/flet_server_protocol_tcp_socket.dart:125)
                                                                                                        #7      FletTcpSocketServerProtocol.connect.<anonymous closure> (package:flet/src/flet_server_protocol_tcp_socket.dart:94)
                                                                                                        #8      _RootZone.runUnaryGuarded (dart:async/zone.dart:1778)
                                                                                                        #9      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381)
                                                                                                        #10     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312)
                                                                                                        #11     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798)
                                                                                                        #12     _StreamController._add (dart:async/stream_controller.dart:663)
                                                                                                        #13     _StreamController.add (dart:async/stream_controller.dart:618)
                                                                                                        #14     _Socket._onData (dart:io-patch/socket_patch.dart:2904)
                                                                                                        #15     _RootZone.runUnaryGuarded (dart:async/zone.dart:1778)
                                                                                                        #16     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381)
                                                                                                        #17     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312)
                                                                                                        #18     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798)
                                                                                                        #19     _StreamController._add (dart:async/stream_controller.dart:663)
                                                                                                        #20     _StreamController.add (dart:async/stream_controller.dart:618)
                                                                                                        #21     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:2323)
                                                                                                        #22     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1646)
                                                                                                        #23     _microtaskLoop (dart:async/schedule_microtask.dart:40)
                                                                                                        #24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)

commit 1c040ef
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Sun May 18 20:13:06 2025 -0400

    Preparing Flet v0.28.3 release (#5306)

    * Fix images displaying in web mode with non-empty page name

    Fix #5198

    * Fix page.on_view_pop event handling

    Fix #5302

    * Fix FilePicker.save_file() for Android and iOS

    Fix #5301

    * PubSub: allow multiple subscribers per session, per topic

    Close #5303

    * Bump version to 0.28.3, updated changelog

commit 69e4e10
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Sat May 10 13:49:30 2025 -0700

    Prepare Flet 0.28.2 (#5295)

    * Added missing imports into `__init__.py`

    * Changelog, bumped version to 0.28.2

    * fix WindowDragArea

    * update code in readme

    * Upated changelog

    ---------

    Co-authored-by: ndonkoHenri <robotcoder4@protonmail.com>

commit 7ce8e48
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Thu May 8 12:38:37 2025 -0700

    Update .appveyor.yml

commit deb38c7
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Thu May 8 09:11:14 2025 -0700

    v0.28.0 release notes (#5286)

    * v0.28.0 release notes

    * Fix "Fixed:"

commit fcc712f
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Wed May 7 10:29:03 2025 -0700

    `View.can_pop` and `View.on_confirm_pop` (#5284)

    * View.can_pop and View.on_confirm_pop

    * Dismissible and View: added 5 minutes timeout for confirm callbacks

commit c3d550a
Author: Owen McDonnell <7119543+OwenMcDonnell@users.noreply.github.com>
Date:   Sat May 3 16:41:10 2025 -0700

    Update CONTRIBUTING.md (#5268)

    note about activating .zprofile variables.

commit f4b83ae
Author: bl1nch <130155870+bl1nch@users.noreply.github.com>
Date:   Tue Apr 29 07:31:08 2025 +0600

    UTF-8 encoding for pyproject.toml (#5203)

commit e3f4d16
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Fri Apr 4 17:17:48 2025 -0700

    Update reorderable_list_view.dart

commit add9c61
Author: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com>
Date:   Sat Apr 5 02:10:23 2025 +0200

    feat: custom `ReorderableListView` drag handle listeners (#5051)

    * initial commit

    * `ReorderableListView`: mouse_cursor, show_default_drag_handles

    * generated files

    * flutter 3.29.0

commit 440009d
Author: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com>
Date:   Sat Apr 5 02:04:32 2025 +0200

    feat: expose events (`on_double_tap`, `on_pan_start`) in `WindowDragArea` (#5043)

    * improve events typing in gesture_detector.py

    * window.start_dragging

    * delete window_drag_area.dart

    * rework WindowDragArea inheriting from GestureDetector

    * export more utils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants