Code Monkey home page Code Monkey logo

fancy-flutter-alert-dialog's Introduction

Fancy Flutter Alert Dialog

Hits

Build Status Coverage Status GitHub release (latest by date)

GitHub stars Twitter Follow

Pure Dart and Flutter package for Android,IOS and Web

A flutter Package to show custom alert Dialog,you can choose between two themes 'Fancy' and 'Flat'

The package is available in fancy_dialog

Usage

Import the Package

add this dependencies to your app dependencies: fancy_dialog: ^1.0.4

Use the Package

add this import statement import 'package:fancy_dialog/fancy_dialog.dart';

to show a Basic Dialog

showDialog(
              context: context,
              builder: (BuildContext context) => FancyDialog(
                title: "Fancy Gif Dialog",
                descreption: "This is descreption for fancy gif,you can load any image or gif to be displayed :), and you can choose between two themes Fancy and Flat",
                )
            ) 
          

the title and descreption are required and the rest of the parameters are :

  • okFun : the function to be called when the user press Ok button (positive button)

  • cancelFun : the function to be called when the user press cancel button (negative button)

  • cancelColor : the color of the negative button, by default it's Colors.grey

  • oklColor : the color of the positive button, by default it's Colors.pink

  • ok : the text of the positive button, by default it's 'OK !'

  • cancel : the text of the negative button, by default it's 'cancel'

  • animationType : The type of the animation, there are 4 types,which are :

    • FancyAnimation.LEFT_RIGHT the default one
    • FancyAnimation.RIGHT_LEFT
    • FancyAnimation.TOP_BOTTOM
    • FancyAnimation.BOTTOM_TOP
  • gifpath : the path for the image or the GIF to be displayed,or you can choose between 6 Gifs the package provides :

    • FancyGif.MOVE_FORWARD the default one
    • FancyGif.CHECK_MAIL
    • FancyGif.FUNNY_MAN
    • FancyGif.PLAY_MEDIA
    • FancyGif.SUBMIT
    • FancyGif.SHARE
  • theme : Fancy or Flat

    • FancyTheme.FANCY
    • FancyTheme.FLAT

The dialog will be dissmised by default when the user click Ok or cancel, DON'T ADD Navigator.of(context).pop() to okFun or cancelFun

ScreenShots

Contribution

Feel free to contribute,report a bug or to suggest a feature

Thank you :)

fancy-flutter-alert-dialog's People

Contributors

dokkarrachidreda avatar liudonghua123 avatar phelickz avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

fancy-flutter-alert-dialog's Issues

Height calculation error?

The following code is ok.

    showDialog(
        context: context,
        builder: (BuildContext context) => FancyDialog(
              title: "Fancy Gif Dialog",
              descreption: "确定删除这一项么?",
            ));

image

However If I change the title to Chinese characters like this, Then some errors occured.

    showDialog(
        context: context,
        builder: (BuildContext context) => FancyDialog(
              title: "删除",
              descreption: "确定删除这一项么?",
            ));

image

The following is the log of debug console.

image


════════ Exception caught by rendering library ═════════════════════════════════
The following assertion was thrown during layout:
A RenderFlex overflowed by 5.6 pixels on the bottom.

The relevant error-causing widget was
    FancyDialog 
lib\pages\clue_fragment.dart:157
The overflowing RenderFlex has an orientation of Axis.vertical.
The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.

Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderFlex to fit within the available space instead of being sized to their natural size.
This is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView.

The specific RenderFlex in question is: RenderFlex#c6c02 OVERFLOWING

Can we use it without context ?

HI i want to display alert box from my service class where context is not present,
can you make it to work without context ?

It will be good feature.

No named parameter with the name 'nullOk'

Bonjour,

j'avais l'erreur "No named parameter with the name 'nullOk'" et pour le corriger j'ai juste remplacé dans le fichier fancy_dialog.dart la ligne 139 par:
assert(MediaQuery.of(context) != null,'\n*context does not contain media query object\n');

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.