GithubHelp home page GithubHelp logo

patilankits / flutter-materialalertdialog Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 2.0 1.09 MB

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

Dart 100.00%

flutter-materialalertdialog's Introduction

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.

flutter-materialalertdialog's People

Contributors

patilankits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.