Skip to content

v1: rework WindowDragArea #5349

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 3 commits into
base: v1
Choose a base branch
from
Open

v1: rework WindowDragArea #5349

wants to merge 3 commits into from

Conversation

ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Jun 5, 2025

Test Code

def main(page: ft.Page):
    page.add(
        ft.WindowDragArea(
            content=ft.Container(ft.Text("Test")),
            on_double_tap=print,
            on_drag_end=print,
            on_drag_start=print,
        )
    )

Summary by Sourcery

Rework the WindowDragArea control to use the new ConstrainedControl base in Python, consolidate its event properties, and provide a matching Dart-side implementation in the Flutter extension.

New Features:

  • Add support for an on_drag_end event callback.
  • Introduce a Dart WindowDragAreaControl widget to render and handle drag and double-tap behavior.
  • Switch to using WindowEvent for double-tap maximize/unmaximize events and dedicated DragStartEvent/DragEndEvent types for drag callbacks.

Enhancements:

  • Refactor Python WindowDragArea to declare properties (content, maximizable, event handlers) instead of subclassing GestureDetector.
  • Update Flet core extension to register the new WindowDragArea control for Flutter integration.
  • Remove custom handler methods and streamline event triggering logic.

@ndonkoHenri ndonkoHenri requested a review from FeodorFitsner June 5, 2025 05:25
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.

1 participant