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.
While trying to pass
GridView
throughbuild()
functions of custom classes and placing it inside aRow
, grid refuses to show up.Code sample:
Replacing
Row
withColumn
works fine, as well as replacingGridView
withListView
. The problem is specific just for the aforementioned particular combination for some reason.Any tips or workarounds to solve the issue are highly appreciated.