Skip to content

Allow to get_control by key #4776

@albertas

Description

@albertas

Duplicate Check

Describe the requested feature

It would be very convenient to be able to get control by its key. It is possible to set unique control identifier by providing key in the arguments. However, it is not yet possible to retrieve the control by the key, control.uid has to be used instead, which requires Python variable creation and results in more code.

Suggest a solution

Existing get_control(id) method could be improved by allowing to provide id, or the key of control. https://flet.dev/docs/controls/page#get_controlid

Another option could be to add new method get_control_by_key(key) to the page.

Screenshots

No response

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    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