0

I am trying to place containers in different parts of the page. However, the documentation does not provide an example of how to do this. I want to place some of the containers in the middle, and some from the bottom of page. How to do it?

import flet as ft

def main(page: ft.Page):

    page.title = "LIPA" 

    page.vertical_alignment = ft.MainAxisAlignment.CENTER
    page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
 
    greets = ft.Container(
        content= ft.Text("Wellcome", style=ft.TextThemeStyle.TITLE_LARGE)
    )
    login = ft.Container(
        content= ft.TextField(label="Login", autofocus=True),
        width= 300
    )
    password = ft.Container(
        content= ft.TextField(label="Password",password="true"),
        width= 300,
    )
        
    login_btn = ft.Container(
        content= ft.ElevatedButton("GO"),
        width=100,
        margin = 15
    )

    signup_btn = ft.Container(
        content= ft.ElevatedButton("sign up"),
        width=100,
        margin = 15
    )
    
    page.appbar = ft.AppBar(
        title=ft.Text("LIPA", style=ft.TextThemeStyle.TITLE_LARGE,weight="bold"),
        center_title=False,
    )
    

    
    page.add(
             greets,
             login,
             password,
             login_btn,
             signup_btn
             )
 

ft.app(target=main)

I am trying to:

signup_btn.vertical_alignment = ft.MainAxisAlignment.END

but its doesnt work, help

Codemaker2015
  • 12,190
  • 6
  • 97
  • 81

0 Answers0