@@ -37,14 +37,13 @@ At the moment you can write Flet apps in Python and other languages will be adde
3737Here is a sample "Counter" app:
3838
3939``` python title="counter.py"
40- import flet
41- from flet import IconButton, Page, Row, TextField, icons
40+ import flet as ft
4241
43- def main (page : Page):
42+ def main (page : ft. Page):
4443 page.title = " Flet counter example"
45- page.vertical_alignment = " center "
44+ page.vertical_alignment = ft.MainAxisAlignment. CENTER
4645
47- txt_number = TextField(value = " 0" , text_align = " right " , width = 100 )
46+ txt_number = ft. TextField(value = " 0" , text_align = ft.TextAlign. RIGHT , width = 100 )
4847
4948 def minus_click (e ):
5049 txt_number.value = str (int (txt_number.value) - 1 )
@@ -55,17 +54,17 @@ def main(page: Page):
5554 page.update()
5655
5756 page.add(
58- Row(
57+ ft. Row(
5958 [
60- IconButton(icons .REMOVE , on_click = minus_click),
59+ ft. IconButton(ft.Icons .REMOVE , on_click = minus_click),
6160 txt_number,
62- IconButton(icons .ADD , on_click = plus_click),
61+ ft. IconButton(ft.Icons .ADD , on_click = plus_click),
6362 ],
64- alignment = " center" ,
63+ alignment = ft.alignment. center,
6564 )
6665 )
6766
68- flet .app(target = main)
67+ ft .app(main)
6968```
7069
7170To run the app install ` flet ` module:
0 commit comments