Hello i am a beginner in Flet module my goal is center the text.
According to documentation there is a text_align property in text widget.
I tried to use it but not worked.
My code:
import flet as ft
def main(page: ft.Page):
page.title = "Zirinus X Edition"
page.scroll = "adaptive "
title_text = ft.Text(
value=f"Zirinus X",
size=60,
weight=ft.FontWeight.W_100,
text_align="CENTER"
)
page.add(title_text)
page.update()
ft.app(target=main)
UPDATE
I throught i found the solution but still not centering the text.
Code:
import flet as ft
def main(page: ft.Page):
page.title = "Zirinus X Edition"
page.scroll = "adaptive "
title_text = ft.Text(
text_align=ft.TextAlign.CENTER,
value=f"Zirinus X",
size=60,
weight=ft.FontWeight.W_100,
)
page.add(title_text)
page.update()
ft.app(target=main)