-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The ListView cannot be built in UserControl. Once the ListView is added, other controls will not be displayed #331
Comments
A working example using import flet
from flet import Column, ListView, Page, Text, UserControl
class Sidebar(UserControl):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# self.menu = ListView(expand=1, spacing=10, padding=10, auto_scroll=True, )
def build(self):
self.expand = True
menu = ListView(
controls=[
Text("Select a box", color="#232324"),
],
expand=True,
)
return Column(controls=[Text("Sidebar"), menu])
def main(page: Page):
page.title = "Auto-scrolling ListView"
sidebar = Sidebar()
page.add(sidebar)
flet.app(target=main) |
Internal notes: We should prevent user errors like that by checking outer bounds for ListView and other scrollable controls.
|
ok, how get the error in flet |
We have to implement that, not you. |
"Vertical viewport was given unbounded height." This is why i think getting intrinsic data about the widget at runtime is necessary. flet is not providing enough container properties for flutter to compute layouts (unless they are explicitly set of course) an api call should be provided to have flet query the dart side for all the properties in that widget and the tree. hope that makes sense |
The above is a minimum example
The text was updated successfully, but these errors were encountered: