ndialog 2.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • new82

NDialog #

Fork  Star  Watches  Get the library  Example

Custom dialog with blur background and popup animation and ProgressDialog with native style, Made with love by Moch. Nizwar Syafuan

Let's Code! #

This library have 2 Dialog : NDialog and ProgressDialog, you can Custom your dialog with blur background using BlurDialogBackground

NAlertDialog & NDialog

I separate the NDialog class into 2, that is NAlertDialog (NDialog like before) and NDialog (Raw Dialog without blur)

NAlertDialog #

Dialog that will show using blur background, you can custom it easily.

await showDialog(
  context: context,
  builder: (context) {
    return NAlertDialog(
      dialogStyle: DialogStyle(
      onDismiss: () {},
      dismissable: true,
      titleDivider: true),
      title: Text("Hi, This is NAlertDialog"),
      content: Text("And here is your content, hoho... "), 
      actions: <Widget>[
        FlatButton(
          child: Text("You"),
          onPressed: () {},
        ),
        FlatButton(
          child: Text("Are"),
          onPressed: () {},
        ),
        FlatButton(
          child: Text("Awesome"),
          onPressed: () {},
        )
      ],
    );
  }
);

NDialog #

Raw dialog that you can use directly to showDialog without Blur Background

await showDialog(
  context: context,
  builder: (context) {
    return NDialog(
      dialogStyle: DialogStyle(titleDivider: true),
      title: Text("Hi, This is NDialog"),
      content: Text("And here is your content, hoho... "),  
      actions: <Widget>[
        FlatButton(
          child: Text("You"),
          onPressed: () {},
        ),
        FlatButton(
          child: Text("Are"),
          onPressed: () {},
        ),
        FlatButton(
          child: Text("Awesome"),
          onPressed: () {},
        )
      ],
    );
  }
);

ProgressDialog #

ProgressDialog progressDialog = ProgressDialog(context, 
  message:Text("This is the message"), 
  title:Text("This is the title")
);

//You can set Message using this function
progressDialog.setTitle(Text("Loading"));
progressDialog.setMessage(Text("Please Wait, Injecting your phone with my virus"));
progressDialog.show();

await Future.delayed(Duration(seconds: 5));
//Progress Dialog already show? don't worry, you can change the message :D
progressDialog.setTitle(Text("Just Kidding"));
progressDialog.setMessage(Text("I mean, virus of love :*"));

await Future.delayed(Duration(seconds: 5));
progressDialog.dismiss();

Psstt...i make ProgressDialog realy fun... Just using future, this function will show ProgressDialog until future (param) reach the end, you can handle the operation too!

await ProgressDialog.future(context,
  future: Future.delayed(Duration(seconds: 5)),
  onProgressError: (error){
    //Error here
  },
  onProgressFinish: (data){
    //Everything setup
  },
  onProgressCancel: () {
    print("Do something onProgressCancel");
  },
  message: Text("Please Wait"),
  cancelText: Text("Batal"),
  title: Text("Waiting for delay"), 
  dialogStyle: DialogStyle(
    onDismiss: () {
      print("Do something onDismiss");
    },
    barrierDismissable: true
  )
);

BlurDialogBackground #

Now you can blur any dialog, simply wrap them with BlurDialogBackground

await showDialog(
  context: context,
  builder: (context) {
    return BlurDialogBackground(
      dialog: AlertDialog(
        title: Text("Alert Dialog"),
        content: Text("Wohoo.. This is ordinary AlertDialog with Blur background"),
        actions: <Widget>[
          FlatButton(
            child: Text("You"),
            onPressed: () {},
          ),
          FlatButton(
            child: Text("Are"),
            onPressed: () {},
          ),
          FlatButton(
            child: Text("Awesome"),
            onPressed: () {},
          )
        ],
      ),
    );
  }
);

That's it, have fun 😀

Screenshot #

[2.0.2] - 10 Oct 2019

  • Fix set blur on progressdialog

[2.0.1] - 10 Oct 2019

  • Fix Return value from ProgressDialog.future

[2.0.0] - 09 Oct 2019

  • You can blur any dialog background using BlurDialogBackground.
  • separate the NDialog class into 2, NDialog and NAlertDialog.
  • Fix bugs when the screen gets smaller (for example when the keyboard appears)

[1.2.1+3] - 07 Oct 2019

  • Fix ProgressDialog bug and layouting

[1.2.1+2] - 07 Oct 2019

  • Fix Bug (Health issues still there -_-)

[1.2.1+1] - 07 Oct 2019

  • Fix Bug (Health issues)

[1.2.1] - 07 Oct 2019

  • Fix ProgressDialog bug and layouting

[1.2.0] - 07 Oct 2019

  • Add ProgressDialog
  • Add ProgressDialog with Future
  • Set your dialog look with DialogStyle

[1.1.0] - 03 Oct 2019

  • Fix overflow actions

[1.0.0] - 02 Oct 2019

  • First release.

example/README.md

Example #

This library have 2 Dialog : NDialog and ProgressDialog

NAlertDialog & NDialog

I separate the NDialog class into 2, that is NAlertDialog (NDialog like before) and NDialog (Raw Dialog without blur)

NAlertDialog #

Dialog that will show using blur background, you can custom it easily.

await showDialog(
  context: context,
  builder: (context) {
    return NAlertDialog(
      dialogStyle: DialogStyle(
      onDismiss: () {},
      dismissable: true,
      titleDivider: true),
      title: Text("Hi, This is NDialog"),
      content: Text("And here is your content, hoho... "), 
      actions: <Widget>[
        FlatButton(
          child: Text("You"),
          onPressed: () {},
        ),
        FlatButton(
          child: Text("Are"),
          onPressed: () {},
        ),
        FlatButton(
          child: Text("Awesome"),
          onPressed: () {},
        )
      ],
    );
  }
);

NDialog #

Raw dialog that you can use directly to showDialog without Blur Background

await showDialog(
  context: context,
  builder: (context) {
    return NDialog(
      dialogStyle: DialogStyle(titleDivider: true),
      title: Text("Hi, This is NDialog"),
      content: Text("And here is your content, hoho... "),  
      actions: <Widget>[
        FlatButton(
          child: Text("You"),
          onPressed: () {},
        ),
        FlatButton(
          child: Text("Are"),
          onPressed: () {},
        ),
        FlatButton(
          child: Text("Awesome"),
          onPressed: () {},
        )
      ],
    );
  }
);

ProgressDialog #

ProgressDialog progressDialog = ProgressDialog(context, 
  message:Text("This is the message"), 
  title:Text("This is the title")
);

//You can set Message using this function
progressDialog.setTitle(Text("Loading"));
progressDialog.setMessage(Text("Please Wait, Injecting your phone with my virus"));
progressDialog.show();

await Future.delayed(Duration(seconds: 5));
//Progress Dialog already show? don't worry, you can change the message :D
progressDialog.setTitle(Text("Just Kidding"));
progressDialog.setMessage(Text("I mean, virus of love :*"));

await Future.delayed(Duration(seconds: 5));
progressDialog.dismiss();

Psstt...i make ProgressDialog realy fun... Just using future, this function will show ProgressDialog until future (param) reach the end, you can handle the operation too!

await ProgressDialog.future(context,
  future: Future.delayed(Duration(seconds: 5)),
  onProgressError: (error){
    //Error here
  },
  onProgressFinish: (data){
    //Everything setup
  },
  onProgressCancel: () {
    print("Do something onProgressCancel");
  },
  message: Text("Please Wait"),
  cancelText: Text("Batal"),
  title: Text("Waiting for delay"), 
  dialogStyle: DialogStyle(
    onDismiss: () {
      print("Do something onDismiss");
    },
    barrierDismissable: true
  )
);

BlurDialogBackground #

Now you can blur any dialog, simply wrap them with BlurDialogBackground

await showDialog(
  context: context,
  builder: (context) {
    return BlurDialogBackground(
      dialog: AlertDialog(
        title: Text("Alert Dialog"),
        content: Text("Wohoo.. This is ordinary AlertDialog with Blur background"),
        actions: <Widget>[
          FlatButton(
            child: Text("You"),
            onPressed: () {},
          ),
          FlatButton(
            child: Text("Are"),
            onPressed: () {},
          ),
          FlatButton(
            child: Text("Awesome"),
            onPressed: () {},
          )
        ],
      ),
    );
  }
);

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  ndialog: ^2.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:ndialog/ndialog.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
63
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
82
Learn more about scoring.

We analyzed this package on Oct 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0
flutter 0.0.0
simple_animations ^1.3.3 1.3.3
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test