Skip to content

Commit

Permalink
Create counter app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Rogendo authored Sep 3, 2023
1 parent cfd93a0 commit 10bdeb5
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions counter app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import flet as ft
from flet import *

def main(page :ft.Page):
page.title="counter app"
page.vertical_allignment= "center"
page.theme_mode = "system"

text_input=ft.TextField(value="0", text_align="center")

def minus_clicked(e):
text_input.value=int(text_input.value) -1
page update

def plus_clicked(e):
text_input.value=int(text_input.value)+1
page.update

page.add(
ft.Row(
controls[
ft.IconButton(ft.icons.REMOVE, on_click=minus_clicked),
text_input,
ft.IconButton(ft.icons.PLUS, on_click=plus_clicked),

],
alignment="center"
)
)

ft.app(target=main)

0 comments on commit 10bdeb5

Please sign in to comment.