A package for flutter to use alert and toast within one line code.

Related tags

Widgets easy_alert
Overview

pub package

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 flutter packages get in your project root directory.

Showcases

ROADMAP

  • alert
  • ios style alert
  • confirm
  • ios style confirm
  • toast
  • customize alert dialog
  • customize toast
  • support bottom sheet.
  • support input
  • support pick and select

Integrate with your flutter app

void main() => runApp(new AlertProvider(
      child: new YourApp(),
      config: new AlertConfig(
        ok: "OK text for `ok` button in AlertDialog", 
        cancel: "CANCEL text for `cancel` button in AlertDialog"),
    ));

alert

Alert.toast(context, "You just click ok")); ">
  Alert.alert(context, title: "Hello", content: "this is a alert")
      .then((_) => Alert.toast(context, "You just click ok"));

confirm

Alert.toast(context, ret == Alert.OK ? "ok" : "cancel")); ">
 Alert.confirm(context, title: "Hello", content: "this is a alert")
          .then((int ret) =>
              Alert.toast(context, ret == Alert.OK ? "ok" : "cancel"));

toast

Alert.toast(context,"Very long toast",position: ToastPosition.bottom, duration: ToastDuration.long);

pick

try {
  int index = await Alert.pick(context,
      values: widget.values, index: widget.index);
    ...have selected
} catch (e) {
    ... cancel select
}


try {
    String ret = await Alert.select(context,
        options: [
          Option('A', 'a'),
          Option('B', 'b'),
          Option('C', 'c'),
        ],
        value: 'a');
Alert.toast(context, "You just pick $ret");
} catch (e) {
Alert.toast(context, "Canceled",
    position: ToastPosition.center);
}
You might also like...

🔍 Code generation for selectors of class fields that helps reduce repetitive code

Code generation for selectors of class fields and enum cases that helps reduce repetitive code.

Oct 3, 2022

Cupertino buttons which are used as radio buttons in order to select one value

Cupertino buttons which are used as radio buttons in order to select one value

Flutter Cupertino Radio Choice Cupertino buttons which are used as radio buttons in order to select one value. Tutorial A complete tutorial how to use

Sep 18, 2022

Dialog-manager - A Flutter package that allows for neater declaration, abstraction and use of customisable dialogs

flutter_dialog_manager A Flutter package that allows for neater declaration, abs

Dec 28, 2022

A Simple and easy to use flutter package for showing progress bar.

A Simple and easy to use flutter package for showing progress bar.

progress_dialog A Simple and easy to use flutter package for showing progress bar. #Usage Import the package import 'package:custom_progress_dialog/cu

May 23, 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

Dec 29, 2022

A Highly customizable Phone input Flutter widget that supports country code, validation and contact picker.

A Highly customizable Phone input Flutter widget that supports country code, validation and contact picker.

A Highly customizable Phone input Flutter widget that supports country code, validation and contact picker.

Jun 7, 2022

A Redux version tailored for Flutter, which is easy to learn, to use, to test, and has no boilerplate

A Redux version tailored for Flutter, which is easy to learn, to use, to test, and has no boilerplate

A Redux version tailored for Flutter, which is easy to learn, to use, to test, and has no boilerplate. Allows for both sync and async reducers.

Dec 13, 2022

Flutter ColorFilter generator and presets to use with ColorFiltered widget.

Flutter ColorFilter generator and presets to use with ColorFiltered widget.

Jun 7, 2022

Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.

Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.

sticky_and_expandable_list Flutter implementation of sticky headers and expandable list.Support use it in a CustomScrollView. README i18n:中文说明 Feature

Nov 16, 2022
Comments
  • A `AlertProvider` must be supplied

    A `AlertProvider` must be supplied

    I'm trying add in my flutter project My Code:

    @override
     Widget build(BuildContext context) {
    
    ....
    
    Alert.toast(context, "My msg",position: ToastPosition.bottom, duration: ToastDuration.long);
    ...
    }
    

    Error:

    A AlertProvider must be supplied I/flutter ( 9175): 'package:easy_alert/easy_alert.dart': Failed assertion: line 90 pos 12: 'manager != null'

    image

    opened by rahulmahadik 1
Owner
null
SKAlertDialog - A highly customizable, powerful and easy-to-use alert dialog for Flutter.

SKAlertDialog A highly customizable, powerful and easy-to-use alert dialog for Flutter. GIF Screenshots SKAlertDialog Basic Alert Alert with buttons A

Senthil_Kumar 7 May 18, 2022
A really easy to use flutter toast library

BotToast ?? A really easy to use flutter toast library! Language: English | 中文简体 ?? Overview ?? Online Demo ?? Example ?? Renderings ?? Getting starte

null 719 Dec 28, 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 multi select form field using alert dialog to select multiple items with checkboxes and showing as chips.

A multi select form field using alert dialog to select multiple items with checkboxes and showing as chips.

Carlos Eugenio Torres 73 Sep 7, 2022
Provider support for overlay, make it easy to build toast and In-App notification.

overlay_support Provider support for overlay, make it easy to build toast and In-App notification. this library support ALL platform Interaction If yo

Bin 340 Jan 1, 2023
A pure flutter toast library

oktoast A library for flutter. A pure dart toast Library. You can completely customize the style of toast. 中文博客介绍 Screenshot Default Custom GIF Versio

OpenFlutter 438 Dec 24, 2022
A widget which implicitly launches a hero animation when its position changed within the same route.

local_hero A widget which implicitly launches a hero animation when its position changed within the same route. Getting started In the pubspec.yaml of

Romain Rastel 174 Jan 6, 2023
A Flutter library to add the Common effect (line, bubble, dot ...) of tab indicator.

flutter_tab_indicator A Flutter library to add the Common effect (line, bubble, dot ...) of tab indicator. Showcases Installation Showcases Showcases

CrabMan 14 Jun 19, 2022
A widget displaying children in a line with an overflow indicator at the end if there is not enough space.

overflow_view A widget displaying children in a line with an overflow indicator at the end if there is not enough space. Features Renders children hor

Romain Rastel 153 Dec 19, 2022
The complete solution for Dart command-line interfaces

The complete solution for Dart command-line interfaces, inspired by node commander.js which created by tj.

Axetroy 6 Feb 21, 2020