Adding missing widget Expanded. #4945
Closed
qwerty108109
started this conversation in
Ideas
Replies: 3 comments 1 reply
-
Here you are: https://flet.dev/docs/controls#expand |
Beta Was this translation helpful? Give feedback.
1 reply
-
Maybe I'm missing something. I cannot get it to expand all the way down forward to left, right, or top. import flet as ft
def main(page: ft.Page):
page.add(
ft.SafeArea(
ft.Column(controls=[
ft.Row(
[
ft.Card(content=ft.Text("Home_1"),color=ft.Colors.ORANGE_300,expand=2),
ft.Card(content=ft.Text("Home_1"),color=ft.Colors.GREEN_100,expand=2,)
],expand=True,),
],expand=True),
)
)
ft.app(main) Even when I do this, I cannot get it to expand all the way to left, right, and top for these two cards to fit together snugly. Without any gap. import flet as ft
def main(page: ft.Page):
page.add(
ft.SafeArea(
ft.Column(controls=[
ft.Row(
[
ft.Card(content=ft.Text("Card_1"),color=ft.Colors.ORANGE_300,expand=2,height=page.height),
ft.Card(content=ft.Text("Card_2"),color=ft.Colors.GREEN_100,expand=2,height=page.height)
],expand=True,),
],expand=True),
)
)
ft.app(main) |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have found it if anybody is looking for this in the future. import flet as ft
def main(page: ft.Page):
page.spacing=0
page.padding=0
page.add(
ft.Column(controls=[
ft.Row(
[
ft.Card(content=ft.Text("Card_1"),color=ft.Colors.ORANGE_300,expand=True,height=page.height,margin=0),
ft.Card(content=ft.Text("Card_2"),color=ft.Colors.GREEN_100,expand=True,height=page.height,margin=0)
],expand=True,spacing=0),
],expand=True,spacing=0),
)
ft.app(main) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just wanted to get everybody's thigh on this.
We seem to be missing the expanded widget in flet. I just wanted to get other people's ideas and opinions on this.
I never knew how much I relied on this until this widget was not there. When I'm natively coding a flutter.
Here's the documentation in case you're not familiar with it on api.flutter.dev.
https://api.flutter.dev/flutter/widgets/Expanded-class.html
In the past, I've used the expanded widget as an easy way to make it expand upwards and downwards at the same time.
We're just wrapping with several expanded widgets around the row and the column.
Beta Was this translation helpful? Give feedback.
All reactions