Performance when visible is False
Open
@FeodorFitsner is already working on this.
Since Sep 29, 2025.
bug
has reproducible steps
performance
- Dominant language
- Python
- Stars
- 17k
- Forks
- 694
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 33
Description
Two examples here, one with 100x100 container on stack ( only 20x20 are visible ) and the other with just 20x20.
here is the code
for 100x100 ( only 20x20 visible )
from jupyflow import Cell, OutputArea
from flet import *
import random
import flet as ft
def main(page: ft.Page):
page.title = "GridView Example"
page.theme_mode = ft.ThemeMode.DARK
# page.padding = 50
page.update()
container_grid = []
for y in range(100):
for x in range(100):
container_grid.append(
Container(
expand=False,
width=50,
height=50,
bgcolor=colors.LIGHT_BLUE_50,
border_radius=0,
margin=0,
padding=0,
top=y * (50 + 1),
left=x * (50 + 1),
clip_behavior=ClipBehavior.NONE,
visible=True if y < 20 and x < 20 else False,
)
)
def on_pan_update(e: ft.DragUpdateEvent):
stack_a.top = stack_a.top + e.delta_y
stack_a.left = stack_a.left + e.delta_x
stack_a.update()
stack_a = Stack(
controls=container_grid
+ [
GestureDetector(
on_pan_update=on_pan_update,
)
],
width=5000,
height=5000,
top=-50,
left=-50,
)
stack_b = Stack(
controls=[stack_a],
width=2000,
height=1500,
)
page.add(stack_b)
page.update()
ft.app(target=main, view=ft.WEB_BROWSER)
for 20x20 visible
from jupyflow import Cell, OutputArea
from flet import *
import random
import flet as ft
def main(page: ft.Page):
page.title = "GridView Example"
page.theme_mode = ft.ThemeMode.DARK
# page.padding = 50
page.update()
container_grid = []
for y in range(20):
for x in range(20):
container_grid.append(
Container(
expand=False,
width=50,
height=50,
bgcolor=colors.LIGHT_BLUE_50,
border_radius=0,
margin=0,
padding=0,
top=y * (50 + 1),
left=x * (50 + 1),
clip_behavior=ClipBehavior.NONE,
visible=True if y < 20 and x < 20 else False,
)
)
def on_pan_update(e: ft.DragUpdateEvent):
stack_a.top = stack_a.top + e.delta_y
stack_a.left = stack_a.left + e.delta_x
stack_a.update()
stack_a = Stack(
controls=container_grid
+ [
GestureDetector(
on_pan_update=on_pan_update,
)
],
width=5000,
height=5000,
top=-50,
left=-50,
)
stack_b = Stack(
controls=[stack_a],
width=2000,
height=1500,
)
page.add(stack_b)
page.update()
ft.app(target=main, view=ft.WEB_BROWSER)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.