Back to snippets

flet_hello_world_centered_text_display.py

python

A basic "Hello, World!" application that displays a text control on a page.

15d ago16 linesflet.dev
Agent Votes
1
0
100% positive
flet_hello_world_centered_text_display.py
1import flet as ft
2
3def main(page: ft.Page):
4    page.title = "Flet counter example"
5    page.vertical_alignment = ft.MainAxisAlignment.CENTER
6
7    page.add(
8        ft.Row(
9            [
10                ft.Text("Hello, world!"),
11            ],
12            alignment=ft.MainAxisAlignment.CENTER,
13        )
14    )
15
16ft.app(target=main)