Code Monkey home page Code Monkey logo

flutter-alertify's Introduction

✨ Flutter Alertify

![pub package]

A collection of beautiful animated dialogs.

🎖 Installing

dependencies:
  alertify: "^0.0.2"

⚡️ Import

import 'package:alertify/alertify.dart';

🎮 How To Use

 Alertify(
  content: 'Some content here',
  context: context,
  isDismissible: true,
  title: 'Alertify',
  alertType: AlertifyType.success,
  buttonText: 'OK',
  animationType: AnimationType.outToIn,
  barrierColor: Colors.black.withOpacity(0.5),
  onDismiss: () {
    // Your code here
  },
).show();

❗️ Note

  • Pull requests are welcomed

⭐️ License

MIT License

flutter-alertify's People

Contributors

maickonn avatar right7ctrl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter-alertify's Issues

onPressed Action?

Hi,

Is there an onPressed or onTap action available for this? Id like to pop or push on a response to the dialogue.

Alertify not properly dismissing, popping back to the previous fullscreen page.

Hello, I"m currently having some trouble with implementing Alertify into our code. The following code is the request to our API to validate a user's document (details are obfuscated due to proprietary code).

void postRequestFunction() async {
    if (...) {
      showAlertDialog(context);
      ...URL cleanup code
      ...Document cleanup code
      try {
        // Send request code
        if (res.statusCode == 200) {
          Navigator.of(context, rootNavigator: true).pop();
          print(resBody);
          Navigator.push(context,
              MaterialPageRoute(builder: (context) => ValidarTokenSMS()));
        } else {
          Navigator.of(context, rootNavigator: false).pop();
          Alertify(
            content: body,
            context: context,
            isDismissible: true,
            title: title,
            alertType: AlertifyType.warning,
            buttonText: 'Ok',
            animationType: AnimationType.outToIn).show();
        }
      } catch (error) {
        await utils.reportError(error);
      }
    } else {
      Alertify(
        content: body,
        context: context,
        isDismissible: true,
        title: title,
        alertType: AlertifyType.warning,
        buttonText: 'Ok',
        animationType: AnimationType.outToIn)
      .show();
    }
  }

The problem that is happening is:

I'm entering the signup page. Then the user types in the stuff, it sends the request and we open a popup to say it's loading. It returns an error (intentional). The Alertify popup appears. I click the ok to dismiss, it pops me back to the login page, but doesn't pop the Alertify popup - continuing to click the ok throws FlutterErrors (for trying to pop a guy that is no longer in the widget tree). It does let me click outside the popup to dismiss it, though.

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.