Skip to content

GestureDetector should have at least one event handler defined #5293

@eharvey9s

Description

@eharvey9s

Duplicate Check

Describe the bug

When creating a WindowDragArea with the example code I get the above error.

Code sample

Code
import flet as ft


def main(page: ft.Page):
    page.window.title_bar_hidden = True
    page.window.title_bar_buttons_hidden = True

    page.add(
        ft.Row(
            [
                ft.WindowDragArea(
                    ft.Container(
                        ft.Text(
                            "Drag this area to move, maximize and restore application window."
                        ),
                        bgcolor=ft.Colors.AMBER_300,
                        padding=10,
                    ),
                    expand=True,
                ),
                ft.IconButton(ft.Icons.CLOSE, on_click=lambda _: page.window.close()),
            ]
        )
    )


ft.app(main)

To reproduce

Create a new flet project using the WindowDragArea example code.

Run the project and the window opens, but the WindowDragArea doesn't load and shows the error:
GestureDetector should have at least one event handler defined

Expected behavior

No response

Screenshots / Videos

Captures

Image

Operating System

Windows

Operating system details

Windows 10

Flet version

0.28.1

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions