feature: Allow changing ResizablePanel size and content
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 56/100
Línea de trabajo
Start with the Python ResizablePanel and ResizablePanelGroup APIs and trace how changes to content and default_size are sent to the Flutter panel widgets. Reproduce the sample by changing both properties after the group is mounted, then inspect the related update path and tests. Done means direct property updates change panel content and sizes without rebuilding the panel list or losing existing scroll state.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Duplicate Check
- I have searched the opened issues and there are no duplicates
Describe the requested feature
Thanks for the nice ResizablePanel addition. I'm requesting some improvements though:
Currently it does not seem to be possible to change the content, or programmatically change the sizes of the ResizablePanels once they have been added to ResizablePanelGroup.panels.
I'd expect the following sample code to change the panel sizes and content when the button is clicked, but neither are changing:
import flet as ft
import flet_shadcn_ui as shad
def main(page: ft.Page):
panelgroup = shad.ResizablePanelGroup(
width=500,
height=200,
panels=[
shad.ResizablePanel(default_size=0.8, content=ft.Text("One")),
shad.ResizablePanel(default_size=0.2, content=ft.Text("Two")),
],
)
page.add(panelgroup)
def on_click():
panelgroup.panels[0].default_size=0.5
panelgroup.panels[0].content=ft.Text("Three")
panelgroup.panels[1].default_size=0.5
panelgroup.panels[1].content=ft.Text("Four")
panelgroup.update()
print("button clicked")
page.add(
ft.Button(
content="click",
on_click=on_click,
)
)
if __name__ == "__main__":
ft.run(main)
If the ResizablePanelGroup.panels list is fully reassigned, the content does seem to change, however the panel sizes remain unchanged:
def on_click():
panelgroup.panels=[
shad.ResizablePanel(default_size=0.5, content=ft.Text("Three")),
shad.ResizablePanel(default_size=0.5, content=ft.Text("Four")),
]
panelgroup.update()
print("button clicked")
However chaning the content this way has the disadvantage that any existing panel content are re-added on the page, and for example the scroll position of any ScrollableControl will be lost.
Only thing that seems to change the sizes currently is if the number of items in ResizablePanelGroup.panels changes:
def on_click():
panelgroup.panels=[
shad.ResizablePanel(default_size=0.6, content=ft.Text("One")),
shad.ResizablePanel(default_size=0.2, content=ft.Text("Two")),
shad.ResizablePanel(default_size=0.2, content=ft.Text("Three")),
]
panelgroup.update()
print("button clicked")
EDIT: I relized that even in this case the default_size values aren't abided, but each ResizablePanel always will be equal size.
Please allow changing the ResizablePanel size and content directly via the content and default_size properties.
Suggest a solution
No response
Screenshots
No response
Additional details
No response
- Lenguaje dominante
- Python
- Estrellas
- 17.6k
- Forks
- 753
- Merge medio
- 2 d 8 h
- PR fusionados (30 d)
- 64
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de flet-dev/flet
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
flet-dev/flet#7102 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
feature: python 3.15 supportAbiertofeature request
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
flet-dev/flet#6985 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
bug: dataclass_transform() uses should include `field_specifiers` argumentPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Desktop 0.86.x: silent callback crashes, ambiguous run_thread/run_task semantics, and focus() no-op via run_taskPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
bug: InputFilter number checkingPosiblemente ocupada @ndonkoHenri la tomó hoy. Abiertobug
flet-dev/flet#7098 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de flet-dev/flet
Issues similares
-
CI flake: test-windows times out spawning Node in tests/test_antigravity_node_hooks.py (develop red)Abiertoarea/ci P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
benchmark
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
mozilla-ai/cq#601 ·
Los mantenedores suelen responder en 1 día
-
Bump Python to 3.14 or 3.15Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día