flet-dev / examples

Flet sample applications
MIT License
423 stars 172 forks source link

Using Row([GridView]) inside build() results in grid not showing up #69

Closed aetherealtea closed 1 year ago

aetherealtea commented 1 year ago

While trying to pass GridView through build() functions of custom classes and placing it inside a Row, grid refuses to show up.

Code sample:

import flet as ft

class Thing(ft.UserControl):

    def build(self):
        self.view = ft.GridView(
            runs_count = 5
        )
        for i in range(0, 60):
            self.view.controls.append(
                ft.Text(f"Text {i}")
            )
        return self.view

class App(ft.UserControl):

    def build(self):
        self.view = ft.Row([Thing()])
        return self.view

def main(page: ft.Page):
    app = App()
    page.add(app)

ft.app(target=main)

Replacing Row with Column works fine, as well as replacing GridView with ListView. The problem is specific just for the aforementioned particular combination for some reason.

Any tips or workarounds to solve the issue are highly appreciated.

aetherealtea commented 1 year ago

Wrong repo, resubmitting the issue in the main one.