A new flutter package project which contains lots of beautiful alert dialog that will help you lot to create beautiful awesome alert box very quickly and easily.

Last update: Jan 8, 2022

flutter_awesome_alert_box

A new flutter package project which contains lots of beautiful alert dialog that will help you lot to create beautiful awesome alert box very quickly and easily.

Show some ❀️ and star the repo to support the project

Details Screenshot Code
Diffrent alert boxes
Simple Alert Box SimpleAlertBox(context: context);
Info Alert Box InfoAlertBox(context: context);
Success Alert Box SuccessAlertBox(context: context);
Warning Alert Box WarningAlertBox(context: context);
Danger Alert Box DangerAlertBox(context: context);
Dark Alert Box DarkAlertBox(context: context);
Simple Alert Box Center SimpleAlertBoxCenter(context: context);
Info Alert Box Center InfoAlertBoxCenter(context: context);
Success Alert Box Center SuccessAlertBoxCenter(context: context);
Warning Alert Box Center WarningAlertBoxCenter(context: context);
Danger Alert Box Center DangerAlertBoxCenter(context: context);
Dark Alert Box Center DarkAlertBoxCenter(context: context);
Confirm Box ConfirmAlertBox(context: context);
Confirm Box Dark ConfirmAlertBoxDark(context: context);
Delete Alert Box DeleteAlertBox(context: context);
Success Backgroung Alert Box SuccessBgAlertBox(context: context);
Info Backgroung Alert Box InfoBgAlertBox(context: context);
Warning Backgroung Alert Box WarningBgAlertBox(context: context);
Danger Backgroung Alert Box DangerBgAlertBox(context: context);
Dark Backgroung Alert Box DarkBgAlertBox(context: context);
Simple Backgroung Alert Box SimpleBgAlertBox(context: context);
Custom Backgroung Alert Box CustomBgAlertBox(context: context);

Alert Box Options For SimpleAlertBox,InfoAlertBox,DangerAlert,SuccessAlert,WarningAlert,DarkAlertBox, :

title: [title] used for alert_box title by default its "Your alert title comes here"
icon: [icon] used for  alert_box title Icon
messageText: [messageText] used from main message of alert box by default its "Alert Message Here"
titleTextColor: [titleTextColor] used for  both title Text and Icon color
messageColor: [messageColor] used for main message text color
buttonColor: [buttonColor] used for button background color
buttonTextColor: [buttonTextColor] used for button text color by default its white
buttonText: [buttonText] used for button text value by default its "Yes"

Alert Box Options For DeleteAlertBox:

title: [title] used for alert_box title by default its "Your alert title comes here"
icon: [icon] used for  alert_box title Icon by default its Info icon
messageText: [messageText] used from main message of alert box by default its "Alert Message Here"
titleTextColor: [titleTextColor] used for  both title Text and Icon color by default its black
messageColor: [messageColor] used for main message text color by default its black
buttonColorForYes: [buttonColorForYes] used for button background color by default its Green
buttonTextColorForYes: [buttonTextColorForYes] used for button text color by default its white
buttonTextForYes: [buttonTextForYes] used for button text value by default its "Yes"
buttonColorForNo: [buttonColorForNo] used for button background color by default its Red
buttonTextColorForNo: [buttonTextColorForNo] used for button text color by default its white
buttonTextForNo: [buttonTextForNo] used for button text value by default its "No"
onPressedYes: [onPressedYes] is a function that will call when onpressed Yes button
onPressedNo: [onPressedNo] is a function that will call when onpressed No button

Example Code

[ Center(child: Text("Simple Alert Box")), Wrap( children: [ Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { SimpleAlertBox(context: context); }, color: Colors.purple, child: Text( "Simple", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { InfoAlertBox(context: context); }, color: Colors.blue, child: Text( "Info", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { SuccessAlertBox(context: context); }, color: Colors.green, child: Text( "Success", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { DangerAlertBox(context: context); }, color: Colors.red, child: Text( "Danger", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { WarningAlertBox(context: context); }, color: Colors.orange, child: Text( "Warning", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { DarkAlertBox(context: context); }, color: Colors.black, child: Text( "Dark", style: TextStyle(color: Colors.white), ), ), ) ], ), Center(child: Text("CenterIcon Alert Box")), Wrap( children: [ Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { InfoAlertBoxCenter(context: context); }, color: Colors.blue, child: Text( "Info Center", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { SimpleAlertBoxCenter(context: context); }, color: Colors.blue, child: Text( "Simple Center", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { SuccessAlertBoxCenter(context: context); }, color: Colors.green, child: Text( "Suceess Center", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { DangerAlertBoxCenter(context: context); }, color: Colors.red, child: Text( "Danger Center", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { WarningAlertBoxCenter(context: context); }, color: Colors.orange, child: Text( "Warning Center", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { DarkAlertBoxCenter(context: context); }, color: Colors.black, child: Text( "Dark Center", style: TextStyle(color: Colors.white), ), ), ), ], ), SizedBox( height: 20, child: Center(child: Text("Confirm Alert Box")), ), Wrap( children: [ Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { ConfirmAlertBox(context: context); }, color: Colors.blue, child: Text( "Confirm Box", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { ConfirmAlertBoxDark(context: context); }, color: Colors.black, child: Text( "Confirm Box Dark", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { DeleteAlertBox(context: context); }, color: Colors.red, child: Text( "Delete Alert", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { SuccessBgAlertBox(context: context); }, color: Colors.green, child: Text( "Success BG Alert", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { DangerBgAlertBox(context: context); }, color: Colors.red, child: Text( "Delete BG Alert", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { WarningBgAlertBox(context: context); }, color: Colors.orange, child: Text( "Warning BG Alert", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { InfoBgAlertBox(context: context); }, color: Colors.blue, child: Text( "Info BG Alert", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { DarkBgAlertBox(context: context); }, color: Colors.black, child: Text( "Dark BG Box", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { SimpleBgAlertBox(context: context); }, color: Colors.blueAccent, child: Text( "Simple BG Box", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { CustomBgAlertBox(context: context); }, color: Colors.deepOrange, child: Text( "Custom BG Box", style: TextStyle(color: Colors.white), ), ), ) ], ) ], ), ); } } ">
import 'package:flutter/material.dart';
import 'package:flutter_awesome_alert_box/flutter_awesome_alert_box.dart';

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State
      
      
       
        {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("flutter_awesome_alert_box"),
        centerTitle: true,
        leading: Padding(
          padding: const EdgeInsets.all(8.0),
          child: FlutterLogo(),
        ),
      ),
      body: ListView(
        children: 
       
       
        
        [
          Center(child: Text("Simple Alert Box")),
          Wrap(
            children: 
        
        
         
         [
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: FlatButton(
                  onPressed: () {
                    SimpleAlertBox(context: context);
                  },
                  color: Colors.purple,
                  child: Text(
                    "Simple",
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: FlatButton(
                  onPressed: () {
                    InfoAlertBox(context: context);
                  },
                  color: Colors.blue,
                  child: Text(
                    "Info",
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: FlatButton(
                  onPressed: () {
                    SuccessAlertBox(context: context);
                  },
                  color: Colors.green,
                  child: Text(
                    "Success",
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: FlatButton(
                  onPressed: () {
                    DangerAlertBox(context: context);
                  },
                  color: Colors.red,
                  child: Text(
                    "Danger",
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: FlatButton(
                  onPressed: () {
                    WarningAlertBox(context: context);
                  },
                  color: Colors.orange,
                  child: Text(
                    "Warning",
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: FlatButton(
                  onPressed: () {
                    DarkAlertBox(context: context);
                  },
                  color: Colors.black,
                  child: Text(
                    "Dark",
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              )
            ],
          ),
          Center(child: Text("CenterIcon Alert Box")),
          Wrap(
            children: 
         
         
          
          [
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: FlatButton(
                  onPressed: () {
                    InfoAlertBoxCenter(context: context);
                  },
                  color: Colors.blue,
                  child: Text(
                    "Info Center",
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: FlatButton(
                  onPressed: () {
                    SimpleAlertBoxCenter(context: context);
                  },
                  color: Colors.blue,
                  child: Text(
                    "Simple Center",
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: FlatButton(
                  onPressed: () {
                    SuccessAlertBoxCenter(context: context);
                  },
                  color: Colors.green,
                  child: Text(
                    "Suceess Center",
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: FlatButton(
                  onPressed: () {
                    DangerAlertBoxCenter(context: context);
                  },
                  color: Colors.red,
                  child: Text(
                    "Danger Center",
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: FlatButton(
                  onPressed: () {
                    WarningAlertBoxCenter(context: context);
                  },
                  color: Colors.orange,
                  child: Text(
                    "Warning Center",
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: FlatButton(
                  onPressed: () {
                    DarkAlertBoxCenter(context: context);
                  },
                  color: Colors.black,
                  child: Text(
                    "Dark Center",
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
            ],
          ),
          SizedBox(
            height: 20,
            child: Center(child: Text("Confirm Alert Box")),
          ),
          Wrap(
            children: 
          
          
            [ Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { ConfirmAlertBox(context: context); }, color: Colors.blue, child: Text( "Confirm Box", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { ConfirmAlertBoxDark(context: context); }, color: Colors.black, child: Text( "Confirm Box Dark", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { DeleteAlertBox(context: context); }, color: Colors.red, child: Text( "Delete Alert", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { SuccessBgAlertBox(context: context); }, color: Colors.green, child: Text( "Success BG Alert", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { DangerBgAlertBox(context: context); }, color: Colors.red, child: Text( "Delete BG Alert", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { WarningBgAlertBox(context: context); }, color: Colors.orange, child: Text( "Warning BG Alert", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { InfoBgAlertBox(context: context); }, color: Colors.blue, child: Text( "Info BG Alert", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { DarkBgAlertBox(context: context); }, color: Colors.black, child: Text( "Dark BG Box", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { SimpleBgAlertBox(context: context); }, color: Colors.blueAccent, child: Text( "Simple BG Box", style: TextStyle(color: Colors.white), ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: FlatButton( onPressed: () { CustomBgAlertBox(context: context); }, color: Colors.deepOrange, child: Text( "Custom BG Box", style: TextStyle(color: Colors.white), ), ), ) ], ) ], ), ); } } 
          
         
         
        
        
       
       
      
      

GitHub

https://github.com/skaran921/flutter_awesome_alert_box
You might also like...

A simple screen that is shown when your app gets crashed instead of the normal crash dialog. It's very similar to the one in Flutter.

A simple screen that is shown when your app gets crashed instead of the normal crash dialog. It's very similar to the one in Flutter.

Red Screen Of Death What A simple screen that is shown when your app gets crashed instead of the normal crash dialog. It's very similar to the one in

Jul 8, 2022

A Very Good Flutter Federated Plugin created by the Very Good Ventures Team πŸ¦„

A Very Good Flutter Federated Plugin created by the Very Good Ventures Team πŸ¦„

Very Good Flutter Plugin Developed with πŸ’™ by Very Good Ventures πŸ¦„ A Very Good Flutter Plugin created by the Very Good Ventures Team. Getting Started

Jun 19, 2022

Awesome aurora gradient - Awesome Aurora Gradients for flutter

Awesome aurora gradient - Awesome Aurora Gradients for flutter

Awesome Aurora Gradient Provides a simple but powerful gradient extension method

Feb 25, 2022

Localize your flutter application quickly and easily.

EzLocalization This package allows you to setup a powerful localization system with ease and in only a few minutes. Features Here are some features: E

Dec 18, 2021

Iosish indicator - 🍎 Create awesome and simple iOS style floating indicator which can be found when silent/sleep mode switched on Flutter.

Iosish indicator - 🍎 Create awesome and simple iOS style floating indicator which can be found when silent/sleep mode switched on Flutter.

Iosish indicator - 🍎 Create awesome and simple iOS style floating indicator which can be found when silent/sleep mode switched on Flutter.

Apr 1, 2022

A super powerful widget to help developers build complex views quickly and comfortably.

A super powerful widget to help developers build complex views quickly and comfortably.

FSuper FSuper can help developers build complex views quickly and comfortably. It supports rich text, rounded corners, borders, pictures, small red do

Aug 1, 2022

A super powerful widget to help developers build complex views quickly and comfortably.

A super powerful widget to help developers build complex views quickly and comfortably.

FSuper FSuper can help developers build complex views quickly and comfortably. It supports rich text, rounded corners, borders, pictures, small red do

Aug 1, 2022

This project is a NGO which let you donate anything or even let you ask for help to people.

ngo_app This app is written in flutter using dart language. Getting Started This project is a NGO which let you donate anything or even let you ask fo

May 8, 2022

Flutter Cupertino text box which can be used to select a date with CupertinoDatePicker

Flutter Cupertino text box which can be used to select a date with CupertinoDatePicker

Flutter Cupertino Date Text Box A text box with an attached CupertinoDatePicker which opens when the text box is tapped. With this library the followi

Feb 13, 2022
Comments
  • 1. Icon(Data) doesn't work/display

    CustomBgAlertBox( context: context, title: "Your height is:", icon: Icons.height, bgColor: secondColor, buttonColor: firstColor, buttonTextColor: secondColor, messageTextColor: fifthColor, titleTextColor: fifthColor );

    The Icon is not displaying in the desired position.

    Reviewed by bit-burger at 2020-10-24 01:04
  • 2. fixed all routines that ingored their icon parameter to use it if it …

    …is provided.

    added Future [result] member variable to all dialogs that present button choices so callers have the option of to 'await DialogObject.result' to get the result sent to pop(). added default result to all pop() calls for dialogs that have more than one button (the button text is sent by default as the result). added pop() calls to all dialogs default [onPressedYes] functions so that the 'Yes' buttons dismiss the dialog by default

    Several of the dialogs ignored their [icon] parameters if they were provided, this has been fixed. I have also added a 'result' Future member to the dialogs that have a yes and no button. This allows the creator/caller of the dialog object to subsequently do something like: var confirmAB = ConfirmAlertBox(onPressedYes: () { Navigator.pop(context, "DELETE"); }, onPressedNo: () { Navigator.pop(context, "CANCEL"); },); String result = await confirmAB.result; if( result=="DELETE" ) { ... }

    (basically use the alert boxes like regular showDialog() calls.) This change has no effect for any use that is not using it. All previous behavior is identical (although the icon parameters are no longer ingored, but that would not be expected behavior)

    Thanks!

    Reviewed by timmaffett at 2021-03-17 06:29
  • 3. Alertboxes incompatible with Cupertino apps or Tab Views?

    I am trying to use the package's alert boxes inside a CupertinoApp, where I use CupertinoTabViews to create a "classic" iOS app.

    However, when calling an AlertBox through an onPressed, the debug console returns

    The ancestors of this widget were CupertinoPageScaffold dependencies: [MediaQuery] state: _CupertinoPageScaffoldState#49b30 CupertinoTabView state: _CupertinoTabViewState#69ec6 CupertinoTabScaffold dependencies: [_InheritedCupertinoTheme, CupertinoUserInterfaceLevel, MediaQuery] state: _CupertinoTabScaffoldState#eb2a2 MainNavView state: _MainNavViewState#bcd3a CupertinoApp state: _CupertinoAppState#d3e74 CupertinoImageApp ...

    And nothing visible happens on screen. Maybe it's just an implementation error on my part, but the error message sounds suspicous ...

    Reviewed by herrmayr at 2020-07-03 08:44

Related

Show beautiful bottom sheet as confirmation dialog quickly and easily.
Show beautiful bottom sheet as confirmation dialog quickly and easily.

sweetsheet Show beautiful bottom sheet as confirmation dialog quickly and easily. nice warning success danger and since version 0.2.0 , it is fully cu

Mar 12, 2022
Adaptive dialog - Show alert dialog or modal action sheet adaptively according to platform.
Adaptive dialog - Show alert dialog or modal action sheet adaptively according to platform.

adaptive_dialog Show alert dialog or modal action sheet adaptively according to platform. showOkAlertDialog Convenient wrapper of showAlertDialog. iOS

Aug 10, 2022
A Very Good Flutter Package Template created by the Very Good Ventures Team πŸ¦„
A Very Good Flutter Package Template created by the Very Good Ventures Team πŸ¦„

Very Good Flutter Package Developed with ?? by Very Good Ventures ?? A Very Good Flutter package created by Very Good Ventures ?? . Getting Started ??

Aug 5, 2022
A Very Good Dart Package Template created by the Very Good Ventures Team πŸ¦„
A Very Good Dart Package Template created by the Very Good Ventures Team πŸ¦„

Very Good Dart Package Developed with ?? by Very Good Ventures ?? A Very Good Dart package created by Very Good Ventures ?? . Getting Started ?? Insta

Aug 5, 2022
A small splashscreen used as intro for flutter applications easily with a lot of customizations ❀️πŸ₯³
A small splashscreen used as intro for flutter applications easily with a lot of customizations ❀️πŸ₯³

Splash Screen A splashscreen package to be used for an intro for any flutter application easily with a lot of customization Currently Supported by awe

Jul 26, 2022
A dart package which provides a lot of helpers functions for easy development.

more_functions A dart package which provides a lot of helpers functions for easy development. Installation Add this to your packages pubspec.yaml file

Dec 5, 2021
This is a Flutter app which shows how to add a Fitted Box in you App

fittedbox A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Oct 25, 2021
A wrapper on top of alert dialog provided by flutter.
A wrapper on top of alert dialog provided by flutter.

material_dialog A wrapper on top of alert dialog provided by flutter. Demo Use this package as a library 1. Depend on it Add this to your package's pu

Jun 17, 2022
Responsive-Ui-builder - The responsive ui builder package contains widgets that helps you to create your UI responsive
Responsive-Ui-builder - The responsive ui builder package contains widgets that helps you to create your UI responsive

Responsive Ui Builder Getting Started The responsive ui builder package contains

Feb 1, 2022
A flutter package which will help you to create a draggable widget that can be dragged around the screen.
A flutter package which will help you to create a draggable widget that can be dragged around the screen.

A flutter package which will help you to create a draggable widget that can be dragged around the screen. Demo Features ?? Manually Control the positi

Aug 10, 2022