[Python] How to align one control to the left, and center the rest in FLET?

Discussão em 'Python' iniciado por Stack, Abril 5, 2025.

  1. Stack

    Stack Membro Participativo

    Im trying to update our website, which was created in PYTHON, with FLET library. I want to position elements on my page. I want logo to be on the left, and form in the middle of the page, absolute-like alingment

    I have tried something like that:

    logo =ft.Image(
    src="example.com/logo.png",
    width=100,
    height=100,
    fit=ft.ImageFit.CONTAIN)

    form_row = ft.Row(
    controls=[query,submit],
    alignment=ft.MainAxisAlignment.CENTER)

    main_row = ft.Row(
    controls=[logo, ft.Container(content=form_row, alignment=ft.alignment.center)],
    alignment=ft.MainAxisAlignment.START,
    vertical_alignment=ft.CrossAxisAlignment.CENTER,

    )
    page.add(main_row)


    But all elements are glued to the left side

    Continue reading...

Compartilhe esta Página