-
Notifications
You must be signed in to change notification settings - Fork 654
Expand file tree
/
Copy pathbasic.py
More file actions
38 lines (33 loc) · 1.12 KB
/
basic.py
File metadata and controls
38 lines (33 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import flet as ft
def main(page: ft.Page):
def handle_button_click(e: ft.Event[ft.ElevatedButton]):
message.value = f"Your favorite color is: {group.value}"
page.update()
page.add(
ft.Text("Select your favorite color:"),
group := ft.RadioGroup(
content=ft.Column(
controls=[
ft.CupertinoRadio(
value="red",
label="Red",
active_color=ft.Colors.RED_200,
inactive_color=ft.Colors.RED_600,
),
ft.CupertinoRadio(
value="green",
label="Green",
fill_color=ft.Colors.GREEN,
),
ft.CupertinoRadio(
value="blue",
label="Blue",
active_color=ft.Colors.BLUE,
),
]
)
),
ft.ElevatedButton(content="Submit", on_click=handle_button_click),
message := ft.Text(),
)
ft.run(main)