[Question] BottomSheet Size in Windows App #1908
-
QuestionHello, I'm currently developing a Windows app using the BottomSheet control. However, after updating the 'flet' module to its latest version, Is there a way to make the BottomSheet cover the entire width without any empty space when using it? Code sampleimport flet as ft
def main(page: ft.Page):
def bs_dismissed(e):
print("Dismissed!")
def show_bs(e):
bs.open = True
bs.update()
def close_bs(e):
bs.open = False
bs.update()
page.window_width = 1280
page.window_height = 960
bs = ft.BottomSheet(
ft.Container(
ft.Column(
[
ft.Text("This is sheet's content!"),
ft.ElevatedButton("Close bottom sheet", on_click=close_bs),
],
tight=True,
),
padding=10,
width=1280,
),
open=True,
on_dismiss=bs_dismissed,
)
page.overlay.append(bs)
page.add(ft.ElevatedButton("Display bottom sheet", on_click=show_bs))
ft.app(target=main) Error messageNo response ------------------------------------------------------
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
you can create your custom bottom sheet using flet if it's not behaving as you intended it to be or go back to older version or copy specific files from older version and paste it in newer version related to bottom sheet best would be to make a custom control |
Beta Was this translation helpful? Give feedback.
-
The solution is mentioned here. def main(page: ft.Page):
page.theme = ft.Theme(use_material3=False)
.... |
Beta Was this translation helpful? Give feedback.
The solution is mentioned here.
You have to set the
use_material3
theme's param toFalse
. By so doing, the BS will automatically fill the page's width. (No more need to even specify a width.)