how to show ModelBottomSheet from top

1k Views Asked by At

guys! ModelBottomSheet shows from bottom. Is there any way to show it from top. or is there another alternate widget for that function. Actually I want to add a filter with a search bar. When I click on it something like ModelSheet should open from top. Please guide me I've added picture of what I want to build.

2

There are 2 best solutions below

2
Jim On

You can try this, sliding_up_panel, slideDirection: SlideDirection.DOWN

PanelController

@override
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: Text("SlidingUpPanelExample"),
    ),
    body: SlidingUpPanel(
      slideDirection: SlideDirection.DOWN,
      panel: Center(
        child: Text("This is the sliding Widget"),
      ),
      body: Center(
        child: Text("This is the Widget behind the sliding panel"),
      ),
    ),
  );
}
1
Muhammad Kamran Nazir On
Scaffold(
          appBar: AppBar(
            title: const Text("SlidingUpPanelExample"),
            actions: [
              PopupMenuButton(
                  itemBuilder: (context) => [
                        PopupMenuItem(
                            child: Container(
                                  child: Column ( children: [......]
                    ),
                  ),
                )
              ],
            ),
          ],
        ),
      ),