A new Flutter MaterialAlertDialog package project.

Overview

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.

You might also like...

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

Flutter package: Define a theme (colors, text styles etc.) as static const values which can be changed dynamically.

Flutter package: Define a theme (colors, text styles etc.) as static const values which can be changed dynamically.

Flutter package: Define a theme (colors, text styles etc.) as static const values which can be changed dynamically. Also comes with useful extensions to create text styles by composition.

Jan 2, 2023

flutter commons package

flutter commons package

Commons Commons Flutter package can used for Flutter Android and IOS applications. https://pub.dev/packages/commons example/lib/main.dart Includes Ale

Dec 21, 2022

Fancy design of radio buttons in Flutter (package).

Fancy design of radio buttons in Flutter (package).

A Flutter package for new radio button design. With Elegant Animation. Features Usage TODO: Include short and useful examples for package users. Add l

Nov 26, 2021

Flutter Package: When your desired layout or animation is too complex for Columns and Rows, this widget lets you position/size/rotate/transform its child in complex ways.

Flutter Package: When your desired layout or animation is too complex for Columns and Rows, this widget lets you position/size/rotate/transform its child in complex ways.

align_positioned Widgets in this package: AlignPositioned AnimatedAlignPositioned AnimChain Why are these widgets an indispensable tool? When your des

Dec 12, 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

An awesome Flutter package with widget extension.

jr_extension An awesome Flutter package with widget extension. Why do I want to create this lib? In SwiftUI framework created

Sep 28, 2022

A vertical tabs package for flutter framework.

A vertical tabs package for flutter framework.

Vertical Tabs A vertical tabs package for flutter framework. Getting Started A simple example of usage. to get more examples see Examples directory. T

Dec 30, 2022

Flutter package: Easy and powerful internationalization using Dart extensions.

Flutter package: Easy and powerful internationalization using Dart extensions.

i18n_extension Non-boilerplate Translation and Internationalization (i18n) for Flutter Start with a widget with some text in it: Text("Hello, how are

Dec 29, 2022
Owner
Ankit Patil
Ankit Patil
A new flutter package for collection of common popular social media widgets

Social Media Widgets - package A new flutter package for collection of common popular social media widgets Currently available widgets Snapchat screen

theboringdeveloper 34 Nov 12, 2022
React hooks for Flutter. Hooks are a new kind of object that manages a Widget life-cycles. They are used to increase code sharing between widgets and as a complete replacement for StatefulWidget.

English | Português Flutter Hooks A Flutter implementation of React hooks: https://medium.com/@dan_abramov/making-sense-of-react-hooks-fdbde8803889 Ho

Remi Rousselet 2.6k Dec 29, 2022
UI Card Designs - A new Flutter application.

UI Card Designs A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you star

Mohit rao 14 Dec 23, 2022
Flutter package: Assorted layout widgets that boldly go where no native Flutter widgets have gone before.

assorted_layout_widgets I will slowly but surely add interesting widgets, classes and methods to this package. Despite the package name, they are not

Marcelo Glasberg 122 Dec 22, 2022
Flutter UI Widgets Flutter Package

Flutter UI Widgets Flutter Package This package makes different Flutter UI widgets implementation easy for you. Flutter UI Widgets The list of widgets

Hassan Ur Rahman 0 May 6, 2022
Flutter Package for Easier Creation of Home Screen Widgets

Home Widget HomeWidget is a Plugin to make it easier to create HomeScreen Widgets on Android and iOS. HomeWidget does not allow writing Widgets with F

Anton Borries 405 Dec 31, 2022
A Flutter package which provides helper widgets for selecting single or multiple account/user from the given list.

account_selector A Flutter package which provides helper widgets for selecting single or multiple account/user from a list Supported Dart Versions Dar

Harpreet Singh 49 Oct 7, 2021
Flutter package: Similar to a ListView, but lets you programmatically jump to any item, by index.

indexed_list_view Similar to a ListView, but lets you programmatically jump to any item, by index. The index jump happens instantly, no matter if you

Marcelo Glasberg 244 Dec 27, 2022
A Styled Toast Flutter package.

flutter_styled_toast A Styled Toast Flutter package. You can highly customize toast ever. Beautify toast with a series of animations and make toast mo

null 67 Jan 8, 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