-
Notifications
You must be signed in to change notification settings - Fork 640
Description
Duplicate Check
- I have searched the opened issues and there are no duplicates
Describe the bug
There is a discrepancy in how the expand property is implemented between the default page root and custom ft.View objects.
When a control with expand=True is added via page.add(), it correctly takes priority over fixed dimensions (like height) and fills the entire available space (both vertically and horizontally).
However, when the same control is placed inside a ft.View (managed via page.views), the expand=True property seems to fail vertically. It only expands horizontally, while the vertical expansion is ignored, and the control stays collapsed or respects a fixed height if provided.
Code sample
Code
import flet as ft
@ft.control
class View(ft.View):
def init(self):
self.route = "/"
async def main(page: ft.Page):
# Try uncommenting these lines to see the difference
# page.views.clear()
# page.views.append(View())
page.add(
ft.Container(
height=10,
expand=True,
bgcolor=ft.Colors.LIME_50
)
)
if __name__ == "__main__":
ft.run(main)To reproduce
Expected behavior
expand=True should consistently force the control to fill all available space in its parent container, but it fails to do so vertically within a ft.View.
Screenshots / Videos
Operating System
Windows
Operating system details
11
Flet version
0.82.2
Regression
Yes, it used to work in a previous Flet version (please specify the version in additional details)
Suggestions
No response
Logs
Logs
[Paste your logs here]Additional details
No response

