flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
11.56k stars 452 forks source link

Alignment issue #4101

Closed Paul0dotPy closed 1 month ago

Paul0dotPy commented 1 month ago

Duplicate Check

Describe the requested feature

Hi, I'm struggling to align two containers, one of which contains a Text widget. Both are inside another container, and I can't figure out how to align them vertically.

Piece of code:

Container(
    bgcolor=self.color_teal,
    padding=5,
    border_radius=10,
    alignment=alignment.center,
    content=ResponsiveRow(
        alignment=MainAxisAlignment.SPACE_BETWEEN,
        controls=[
            # Column(
            #     col={"sm":6, "md":6},
            #     expand=True,
            #     alignment=MainAxisAlignment.CENTER
            #     controls=[
            #         Container(
            #             bgcolor="blue",
            #             border_radius=5,
            #             padding=5,
            #             content=Text("Otras ciudades")
            #         )
            #     ]
            # ),
            Container(
                #expand=True,
                col={"sm":6, "md":6},
                bgcolor="blue",
                border_radius=5,
                #padding=22,
                content=Text("Otras ciudades")
            ),
            #Text("Otras ciudades"),
            Container(
                bgcolor=self.color_teal,
                padding=5,
                col={"sm":6, "md":6, "lg":4},
                content=Dropdown(
                    border_color="transparent",
                    border_radius=20,
                    #width=150,
                    hint_text="Mostrar todo",
                    options=[
                        dropdown.Option("Mostrar todo"),
                        dropdown.Option("Lima"),
                        dropdown.Option("Arequipa")
                    ]
                )
            )
        ]
    )
)

image

OS

Windows 11

Flet version

0.23.2

Additional details

No response