Dialog-manager - A Flutter package that allows for neater declaration, abstraction and use of customisable dialogs

Overview

flutter_dialog_manager

A Flutter package that allows for neater declaration, abstraction and use of customisable dialogs.

Install

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  flutter_dialog_manager: ^1.0.0+2

Import the package in your project:

import 'package:flutter_dialog_manager/flutter_dialog_manager.dart';

Getting started

Wrap your MaterialApp widget with a DialogManager and pass the required GlobalKey<NavigatorState> navigatorKey parameter. Also pass the navigator key to MaterialApp.

@override
  Widget build(BuildContext context) {
    return DialogManager(
      navigatorKey: _navigatorKey,
      child: MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        navigatorKey: _navigatorKey,
        home: const MyHomePage(title: 'Flutter Demo Home Page'),
      ),
    )

Usage

Declare dialog UI implementations and their associated route names with onGenerateDialogs or dialogRoutes

  onGenerateDialogs: (settings) {
        switch (settings.name) {
          case "/counter":
            if (settings.arguments != null) {
              return CounterDialog(
                counter: settings.arguments as int,
              );
            }
            break;
      }}
 dialogRoutes: {
        "/": (context) => DefaultDialog(),
        "/home": (context) => HomeDialog(),
      }

Show dialog in your UI

 DialogManager.of(context).showDialog(
      routeName: "/counter",
      arguments: _counter,
    );

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.

You might also like...

A Flutter widget to show a text form field to display a date or clock dialog

A Flutter widget to show a text form field to display a date or clock dialog

A Flutter widget to show a text form field to display a date or clock dialog. This widget extend TextField and has a similar behavior as TextFormField.

Jan 6, 2023

Flutter overlay loading dialog example

Flutter overlay loading dialog example

flutter_overlay_loading_dialog_example Demo

Mar 24, 2022

A Flutter plugin which makes it straightforward to show the native equivalent of a CupertinoAlertDialog or CupertinoActionSheet dialog

A Flutter plugin which makes it straightforward to show the native equivalent of a CupertinoAlertDialog or CupertinoActionSheet dialog

A Flutter plugin which makes it straightforward to show the native equivalent of a CupertinoAlertDialog or CupertinoActionSheet dialog

Dec 9, 2022

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

πŸš€πŸš€πŸš€ Semantic dialog

πŸš€πŸš€πŸš€ Semantic dialog

✨ flutter_custom_dialog [Language ~~] English | δΈ­ζ–‡ζ–‡ζ‘£ Global dialog function encapsulation, with a semantic way to fill the content inside the dialog,

Dec 2, 2022

The flutter_otp_text_field package for flutter is a TextField widget that allows you to display different style pin.

The flutter_otp_text_field package for flutter is a TextField widget that allows you to display different style pin.

flutter_otp_text_field flutter_otp_text_field The flutter_otp_text_field package for flutter is a TextField widget that allows you to display differen

Nov 8, 2022

The SpannableGrid is a Flutter widget that allows its cells to span columns and rows and supports moving cells inside the grid.

The SpannableGrid is a Flutter widget that allows its cells to span columns and rows and supports moving cells inside the grid.

Spannable Grid The SpannableGrid is a Flutter widget that allows its cells to span columns and rows and supports moving cells inside the grid. Feature

Nov 7, 2022

A package for flutter to use alert and toast within one line code.

A package for flutter to use alert and toast within one line code.

easy_alert A package for flutter to use alert and toast within one line code. Getting Started Add easy_alert: to your pubspec.yaml, and run flutt

Jun 25, 2021

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
Owner
Lucky Ebere
I play a lot of classical chess. I love sad, lo-fi tunes. I value warm conversations with the people I care about. I build stuff. You?
Lucky Ebere
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
A flutter package for displaying common picker dialogs.

Flutter Material Pickers A flutter package containing commonly used material design picker dialogs. Some are new, some wrap existing or built in picke

CodeGrue 89 Jan 2, 2023
A Flutter Package for easy building dialogs

Easy Dialog package helps you easily create basic or custom dialogs. For extended documentation visit project pub package. Star ⭐ this repo if you lik

Ricardo NiΓ±o 39 Oct 14, 2022
A new Flutter package project for simple a awesome dialogs

awesome_dialog A new Flutter package project for simple and awesome dialogs Usage To use this package, add awesome_dialog as a dependency in your pubs

Marcos Rodriguez Toranzo 286 Jan 6, 2023
SKAlertDialog - A highly customizable, powerful and easy-to-use alert dialog for Flutter.

SKAlertDialog A highly customizable, powerful and easy-to-use alert dialog for Flutter. GIF Screenshots SKAlertDialog Basic Alert Alert with buttons A

Senthil_Kumar 7 May 18, 2022
Progress Dialog widget for flutter projects with ability to customize loading widget, background color and background blur.

DISCONTINUED Checkout ArsDialog ars_progress_dialog Customizable progress dialog for Flutter applications with smooth animation for background dim col

Arsam 8 Apr 15, 2022
Flutter progress dialog. Support both Android and iOS platform.

Flutter Progress Dialog [pub packages] | Flutter progress dialog. Support both Android and iOS platform

Dylan Wu 22 Oct 9, 2022
Make your native android Dialog Fancy and Gify.

Make your native android Dialog Fancy and Gify. A library that takes the standard Android Dialog to the next level with a variety of styling options and Gif's. Style your dialog from code.

Shashank Singhal 522 Jan 2, 2023
A multi select form field using alert dialog to select multiple items with checkboxes and showing as chips.

A multi select form field using alert dialog to select multiple items with checkboxes and showing as chips.

Carlos Eugenio Torres 73 Sep 7, 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