Skip to content
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

feat: add ListView.build_controls_on_demand property for optional on-demand building of controls #4751

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Jan 21, 2025

Resolves #3931

Code Example

import flet as ft

def main(page: ft.Page):

    page.add(
        ft.ListView(
            build_controls_on_demand=False,
            controls=[ft.ListTile(ft.Text(f"Item {i}")) for i in range(200)],
        )
    )

ft.app(target=main)

Summary by Sourcery

New Features:

  • Added a ListView.build_controls_on_demand property to improve performance when rendering large lists by building controls on demand.

@FeodorFitsner FeodorFitsner merged commit 6ed3098 into main Jan 22, 2025
3 checks passed
@FeodorFitsner FeodorFitsner deleted the ndonkoHenri/listview-build-controls-on-demand branch January 22, 2025 01:36
@FeodorFitsner FeodorFitsner added this to the Flet v0.26.0 milestone Jan 22, 2025
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.

Optional on-demand creation of ListView.controls
2 participants