Vader Popup

Pub Version GitHub License Build Status

Vader Popup is a Flutter package for creating customizable popup dialogs and modal windows with ease.

Features

  • Simple modal popup
  • Fully customizable popups
  • Support for various popup types (info, warning, error, success)
  • Support special popup dialogs for:
    • ask questions
    • show long message
    • input text message
    • choose from more options

Installation

Add the following dependency to your pubspec.yaml file:

dependencies:
  vader_popup: ^0.1.2

Then run:

flutter pub get

Usage

Basic Usage

To show a basic popup dialog:

PopupDialog().info(
  context: context,
  title: 'Hello, World!',
  message: 'This is a basic popup dialog.',
);

To show a basic modal popup:

PopupModal().show(
  context,
  showCloseButton: true,
  body: Center(
    child: Text("Hello world!"),
  )
);

Customization

Vader Popup allows for extensive customization to fit your needs. You can customize the appearance and behavior of the popups.

Example: Custom Popup

final result = await PopupDialog(
  header: const PopupHeader(
    icon: Icon(Icons.info, color: Colors.blue, size: 70),
    title: PopupText(
      text: "Info dialog",
    ),
  ),
  content: const PopupMessage(
    message: PopupText(text: "Text of info dialog"),
  ),
  buttons: [
    PopupButton(
      label: "Cancel",
      color: Colors.grey.withOpacity(0.4),
      onPressed: () {
        Navigator.of(context).pop("Left button");
      },
    ),
    PopupButton(
      label: "OK",
      color: Colors.blue,
      onPressed: () {
        Navigator.of(context).pop("Right button");
      },
    ),
  ],
).show(context);
print(result);

Vader Popup supports several built-in types of popups:

  • info
  • success
  • warning
  • error
  • modal
  • options
  • question
  • long message

Examples

For more examples see the examples file.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Author

👤 Martin Jablečník

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2024 Martin Jablečník.
This project is licensed under MIT License.