Skip to content

Ability to expand ButtomSheet to the top of the screen #2087

Closed
@FeodorFitsner

Description

@FeodorFitsner

Discussed in #2074

Originally posted by Klu1d November 12, 2023

Question

"ButtomSheet" turned out to be a very successful control element for me. But what I lack in it is the ability to fill the entire screen with this control. For example, as in the images I attached. Or as, for example, "Container (expand=True)". The "ButtonSheet" itself does not have properties such as "expand" or "height" and "width", is it possible to implement this somehow or make at least a temporary solution? So that I can expand the "ButtomSheet" to full screen. Because I can't do it
Снимок экрана от 2023-11-12 23-48-34
Снимок экрана от 2023-11-12 23-43-46

Code sample

import 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()

    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,
            ),
            height=500,
            width=300,
            expand=True,
            padding=10,
        ),
        open=True,
        enable_drag=True,
        on_dismiss=bs_dismissed,
    )
    page.overlay.append(bs)
    page.add(ft.SafeArea(
        ft.ElevatedButton("Display bottom sheet", on_click=show_bs)
    ))

ft.app(target=main)

Error message

No response

------------------------------------------------------

  • I have searched for answers to my question both in the issues and in previous discussions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions