A popup simple topModalSheet menu button widget with handsome design and easy to use

Overview

top_modal_sheet

A popup simple topModalSheet menu button widget with handsome design and easy to use.

Installations

Add top_modal_sheet: ^1.0.0 in your pubspec.yaml dependencies. And import it:

import 'package:top_modal_sheet/top_modal_sheet.dart';

How to use

Simply call showModalTopSheet to display it

(context: context, child: DumyModal()); if(value != null){ setState(() { _topModalData = value; }); } }, )">
MaterialButton(
  color: Colors.white,
  elevation: 5,
  child: const Text("Show TopModal"),
  onPressed: () async {
    var value = await showTopModalSheet<String>(context: context, child: DumyModal());

    if(value != null){
      setState(() {
        _topModalData = value;
      });
    }
  },
)

Here is another way to invoke the modal using a Globalkey to get a smooth pop animation

>(PageRouteBuilder(pageBuilder: (_, __, ___) { return TopModalSheet( key: _topModalSheetKey, child: Container(color: Colors.teal, height: MediaQuery.of(context).size.height * .2, child: Center( child: MaterialButton( color: Colors.white, child: const Text("Back", style: TextStyle(color: Colors.teal),), onPressed: () { _topModalSheetKey.currentState.onBackPressed(data: [1,2,3]); }, ) )), ); }, opaque: false)); if(value != null){ setState(() { _topModalData = "$value"; }); } }, )">
final _topModalSheetKey = GlobalKey<TopModalSheetState>();

MaterialButton(
  color: Colors.white,
  elevation: 5,
  child: const Text("Show TopModal 2"),
  onPressed: () async {
    var value = await Navigator.of(context).push<List<int>>(PageRouteBuilder(pageBuilder: (_, __, ___) {
      return TopModalSheet(
        key: _topModalSheetKey,
        child: Container(color: Colors.teal, height: MediaQuery.of(context).size.height * .2, child: Center(
          child: MaterialButton(
            color: Colors.white,
            child: const Text("Back", style: TextStyle(color: Colors.teal),),
            onPressed: () {
              _topModalSheetKey.currentState.onBackPressed(data: [1,2,3]);
            },
          )
        )),
      );
    }, opaque: false));

    if(value != null){
      setState(() {
        _topModalData = "$value";
      });
    }
  },
)

For a more detail example please take a look at the example folder.

Example

-

If something is missing, feel free to open a ticket or contribute!

You might also like...

Widget to let the user search through a keyword string typed on a customizable keyboard in a single or multiple choices list presented as a dropdown in a dialog box or a menu.

Widget to let the user search through a keyword string typed on a customizable keyboard in a single or multiple choices list presented as a dropdown in a dialog box or a menu.

searchable_dropdown Widget to let the user search through a keyword string typed on a customizable keyboard in a single or multiple choices list prese

Sep 11, 2022

Flutter Color Picker Wheel - an easy to use widget which can be heavily customized

Flutter Color Picker Wheel  - an easy to use widget which can be heavily customized

Flutter Color Picker Wheel Flutter Color Picker Wheel is an easy to use widget which can be heavily customized. You can use the WheelColorPicker direc

Oct 4, 2022

A Simple and easy to use flutter package for showing progress bar.

A Simple and easy to use flutter package for showing progress bar.

progress_dialog A Simple and easy to use flutter package for showing progress bar. #Usage Import the package import 'package:custom_progress_dialog/cu

May 23, 2022

A Widget that mimics the Facebook Reaction Button in Flutter.

A Widget that mimics the Facebook Reaction Button in Flutter.

ReactiveButton A Widget that mimics the Facebook Reaction Button in Flutter. Step by step explanation A full explanation on how to build such Widget m

Jul 12, 2022

AdvFAB - An Advanced floating action button that expands itself to reveal its hidden widget

AdvFAB (More Than Just A Floating Action Button) AdvFAB is An Advanced floating action button that expands itself to reveal its hidden widget. It can

Nov 4, 2022

RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and error animations.

RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and error animations.

rounded_loading_button RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and

Jan 4, 2023

AsyncButtonBuilder offers a simple way to extend any type of button with an asynchronous aspect

AsyncButtonBuilder offers a simple way to extend any type of button with an asynchronous aspect

async_button_builder AsyncButtonBuilder offers a simple way to extend any type of button with an asynchronous aspect. It allows adding loading, disabl

Jul 10, 2022

Simple flutter toggle button widge

Simple flutter toggle button widge

This is simple flutter toggle button widget. Supports show text labels and icons, Possible set multiple value to toggle ui, not only

Sep 27, 2022

A Flutter implementation of the cascading menu.

A Flutter implementation of the cascading menu.

A Flutter implementation of the cascading menu. Due to the war in Ukraine, I'm asking for your support so that my family and I are more likely to stay

Nov 7, 2022
Comments
  • Null Safety

    Null Safety

    For solutions, see https://dart.dev/go/unsound-null-safety Error: Cannot run with sound null safety, because the following dependencies don't support null safety:

    • package:top_modal_sheet

    For solutions, see https://dart.dev/go/unsound-null-safety

    opened by shoaibmalik2611 2
Owner
Baldemar Alejandres
stay awhile and listen.
Baldemar Alejandres
Flutter Duration Button - Create auto-click button likes Netflix's Skip Intro button in Flutter

Flutter Duration Button - Create auto-click button likes Netflix's Skip Intro button in Flutter

Kim Seung Hwan 7 Dec 7, 2022
RFlutter Alert is super customizable and easy-to-use alert/popup dialogs for Flutter.

RFlutter Alert is super customizable and easy-to-use alert/popup dialogs for Flutter. You may create reusable alert styles or add buttons as much as you want with ease.

Ratel 362 Jan 1, 2023
Flutter Triple Status Button can use toggle button but in three statuses.

triple_status_button Triple Status Button. Flutter Triple Status Button can use toggle button but in three statuses. Property Description height heigh

MahdiBagjani 2 Nov 13, 2021
Flutter reaction button plugin it is fully customizable widget such as Facebook reaction button

Flutter Reaction Button Flutter button reaction it is fully customizable widget such as Facebook reaction button. Preview Demo Usage Include 'flutter_

Abdelouahed Medjoudja 174 Dec 19, 2022
Flutter widget to show text in popup or overlay container

flutter_show_more_text_popup Flutter widget to show text in popup or overlay container Installation Add this to your package's pubspec.yaml file depen

Sanjay Sharma 44 Jul 5, 2022
Display simple blurry dialog popup for flutter

Blurry Dialog Features Display simple blurry dialog popup Offer built-in themes Possibility to create you custom dialog button click handler callbacks

Kouki Badr 7 Dec 18, 2022
A button that looks like a Cupertino text button

Cupertino Text Button A button that looks like a Cupertino text button! Text Button A simple text button can be created like this: CupertinoTextButton

Nick Sirovsky 0 Nov 24, 2022
A package that creates a popup when there's no internet connection

internet_popup A package that shows a pop up alert when the internet connection is lost Features auto popUp option to fix or pop the warning one line

DropDew 4 Apr 19, 2022
📸 Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget.

?? Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget. Photo View is largely used to show interacive images and other stuff such as SVG.

Blue Fire 1.7k Jan 7, 2023
This flutter package provides an easy implementation of a Slider Button to cancel current transaction or screen

This flutter package provides an easy implementation of a Slider Button to cancel current transaction or screen

null 222 Nov 8, 2022