ji2026 / Flutter-MaterialAlertDialog

A new Flutter MaterialAlertDialog package project.Flutter package to implement animated, smiling_face_with_three_hearts Attractive, artstylish Material Dialog in Flutter easily

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Material Alert Dialogs for Flutter 📱

A new Flutter package project.

Getting Started

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.

Flutter package to implement animated, 🥰 Attractive, 🎨stylish Material Dialog in Flutter easily.

1. Material Dialog 2. Animated Material Dialog

Introduction

MaterialAlerDialog library is built upon Flutter Material Design library. This API will be useful to create rich, animated, beautiful dialogs in Flutter easily.

1. Material Alert Dialog 2. Animated Material Alert Dialog
This is basic material dialog which has two material buttons (Same as Fluter's AlertDialog) as you can see below. This is Animated material alert dialog which has two material buttons which is showed from bottom of device as you can see below.

Implementation

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.

Use this package as library

1.Depend on it

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);
                      },

                   ),
               );

Credits

This library is built using following open-source libraries.

About

A new Flutter MaterialAlertDialog package project.Flutter package to implement animated, smiling_face_with_three_hearts Attractive, artstylish Material Dialog in Flutter easily

License:Other


Languages

Language:Dart 100.0%