Dropdown(expand=True) silently breaks rendering of entire widget subtree on Android (Flutter mobile)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Comienza con la reproducción de ft.app proporcionada y verifica el subárbol de altura cero en Android; después, compáralo con el comportamiento en escritorio. Traza cómo se gestiona Dropdown(expand=True) a través de la cadena de layout móvil de Flutter, especialmente dentro de ListView y Column. Se considera terminado cuando Card y su Dropdown se renderizan con altura intrínseca en Android sin romper el subárbol circundante, mientras el comportamiento del workaround permanece intacto.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
When ft.Dropdown(expand=True) is placed inside a layout chain of Column → Card → ListView(expand=True) (which in turn sits inside an AnimatedSwitcher(expand=True) or similar expanding ancestor), the entire widget subtree fails to render on Android. On desktop (Flets own engine / Linux/Windows) it works fine — the Dropdown clamps to its intrinsic height and the rest of the tree renders normally.
No error or exception is raised in Python — the page.update() succeeds silently. The Flutter layout pass simply collapses the whole subtree to zero height.
To Reproduce
import flet as ft
def main(page: ft.Page):
page.add(
ft.SafeArea(
expand=True,
content=ft.Column([
ft.Text("Top bar"),
ft.Container(
expand=True,
content=ft.ListView(
expand=True,
controls=[
ft.Card(
content=ft.Container(
padding=15,
content=ft.Column([
ft.Text("Card title", size=18, weight=ft.FontWeight.BOLD),
ft.Dropdown(
expand=True, # ← THIS LINE CAUSES THE BUG
options=[
ft.dropdown.Option("a", "Option A"),
ft.dropdown.Option("b", "Option B"),
],
),
])
)
)
]
)
)
], spacing=0)
)
)
ft.app(target=main)
Result on Android: The screen shows only "Top bar" — the entire Container/ListView/Card below it is invisible (zero-height).
Expected: The Card should render with the Dropdown at its intrinsic height, same as on desktop.
Workaround
Remove expand=True from the Dropdown (or any nested Dropdown inside an expanding scrollable):
ft.Dropdown( # no expand=True
options=[...]
)
Environment
- Flet version: 0.86.1 (also affects 0.28+ — likely all versions)
- Platform: Android (Flutter mobile engine)
- Desktop: works correctly on Linux, Windows, macOS
Root Cause (educated guess)
On desktop, Flutters layout engine clamps unbounded expand requests from a Dropdown to its intrinsic height. On mobile (Android Flutter), the same unconstrained height propagates upward and causes the layout to resolve the entire branch to zero height — effectively a silent layout failure with no error surface shown to the user or the developer.
This is related to how Flutter handles double.infinity constraints inside a Column when a child requests expand=True without an intrinsic size limit. Dropdown is a FormFieldControl whose intrinsic height is finite, but the expand=True flag may bypass that and push infinite height to the parent Column, which cascades up through Card → ListView.
Suggested Fix
Dropdown(expand=True) should clamp to its intrinsic height rather than propagating unconstrained height, or the Flet framework should warn at the Python level when Dropdown (or similar intrinsic-sized controls) is given expand=True inside a scrollable parent.
- Lenguaje dominante
- Python
- Estrellas
- 17.1k
- Forks
- 708
- Merge medio
- 1 d 17 h
- PR fusionados (30 d)
- 46
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
-
bug controls
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
bug: Interactive Viewer renders grey text when passed alignmentPosiblemente ocupada @ndonkoHenri la tomó hace 6 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
flet-dev/flet#6744 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
feature: Dropdown on_click eventAbiertofeature request
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
Todos los issues de flet-dev/flet
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
kornia/kornia#5263 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Metadata correction for W16-5400Abiertoapproved correction metadata
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
acl-org/acl-anthology#10133 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
BasedHardware/omi#20084 ·
Los mantenedores suelen responder en 1 día
-
bug needs-acceptance wg/evaluation-quality
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
vllm-project/semantic-router#4424 ·
Los mantenedores suelen responder en 1 día