Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Dropdown(expand=True) silently breaks rendering of entire widget subtree on Android (Flutter mobile)

Abierto
#6,705 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
android, flutter, python
Área
frontend, mobile

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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de flet-dev/flet

Todos los issues de flet-dev/flet

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.