New Flutter MaterialAlertDialog package project.Flutter package to implement animated, smiling_face_with_three_hearts Attractive, artstylish Material Dialog in Flutter easily.
This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
MaterialAlerDialog library is built upon Flutter Material Design library. This API will be useful to create rich, animated, beautiful dialogs in Flutter easily.
Installation
Implementation of Material Alert Dialog library is so easy. You can check /app directory for demo. Let’s have look on basic steps of implementation.
Add this to your package’s pubspec.yaml file:
dependencies:
material_alertdialog: ^0.0.1
2. Install it
You can install packages from the command line:
$ 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:material_alertdialog/material_alertdialog.dart';
Create AlertDialog Instance
As there are two types of dialogs in library. Material Dialogs are instantiated as follows.
i. MaterialAlertDialog
MaterialDialog
class is used to create MaterialAlertDialog. Its static Builder
class is used to instantiate it.
showDialog(context: context, builder:(context)=> MaterialAlertDialog( height: 250, title: "Exit", message: "Are you sure you want to quit", onPresedPositiveButton: (){ //add what you want for navigate }, onPresedNegativeButton: (){ Navigator.pop(context); }, ), );

ii. AnimatedMaterialAlertDialog
AnimatedMaterialAlertDialog
class is used to create MaterialAlertDialog. Its static Builder
class is used to instantiate it.
showDialog(context: context, builder:(context)=> AnimatedMaterialAlertDialog( imagePath: "assets/steth.jpg" height: 250, title: "Exit", message: "Are you sure you want to quit", onPresedPositiveButton: (){ //add what you want for navigate }, onPresedNegativeButton: (){ Navigator.pop(context); }, ), );
