flet
flet copied to clipboard
trailing control of `ListTile` not shown
def make_project_view(project: Project):
return Card(
content=Container(
content=Column(
[
ListTile(
leading=Icon(icons.WORK),
title=Text(project.title),
subtitle=Text(project.tag),
trailing=PopupMenuButton(
icon=icons.WARNING,
items=[
PopupMenuItem(
icon=icons.EDIT,
text="Edit",
),
PopupMenuItem(
icon=icons.DELETE,
text="Delete",
),
],
)
),
]
),
padding=10,
)
)
While the ListTile is shown, the trailing PopupMenuButton is not.

What do you get with this sample: https://github.com/flet-dev/examples/blob/main/python/controls/listtile/listtiles.py ?
The sample code works fine. I have also solved the problem, without understanding the why: Whether the ListTile is displayed correctly depended on where the Card was added:
- if added to
Columncontained in aRow: trailing control not displayed - if added only to a
Column: trailing control displayed

Any idea why?
It seems like much depends on the context of where the Control is used, which makes it somewhat hard to debug or post a minimal example.
In general, error messages whenever something is not rendered correctly would be a great help.
Could you post a repro code for that?
Difficult for me to tell how much context is needed. Does the full app layout help?
https://github.com/tuttle-dev/tuttle/blob/a0198c5f0804edb566c77e005d8ebc6aba89ed4a/app/Tuttle2.py
https://github.com/tuttle-dev/tuttle/blob/a0198c5f0804edb566c77e005d8ebc6aba89ed4a/app/views.py