[Question][BUG?] the latest version 0.27.0 unable to run todo demo #5008
-
QuestionThis todo example cannot be used. Code sampleclass TodoApp(ft.UserControl):
def build(self):
self.new_task = ft.TextField(hint_text='输入你的待办', expand=True)
self.tasks = ft.Column()
return ft.Column(
width=600,
controls=[
ft.Row(
controls=[
self.new_task,
ft.FloatingActionButton(icon=ft.Icons.ADD, on_click=self.add_clicked),
]
),
self.tasks,
],
)
def add_clicked(self, e):
self.tasks.controls.append(ft.Checkbox(label=self.new_task.value))
self.new_task.value = ''
self.update() Error messageTraceback (most recent call last):
File "F:\adflet\todo.py", line 14, in <module>
class TodoApp(ft.UserControl):
^^^^^^^^^^^^^^
AttributeError: module 'flet' has no attribute 'UserControl' ------------------------------------------------------
|
Beta Was this translation helpful? Give feedback.
Answered by
ndonkoHenri
Mar 6, 2025
Replies: 1 comment
-
Try the (updated) code from docs: https://flet.dev/docs/tutorials/python-todo (fyi: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ndonkoHenri
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try the (updated) code from docs: https://flet.dev/docs/tutorials/python-todo
(fyi:
UserControl
is no longer a Flet control - see the custom controls guide here)