Giter VIP home page Giter VIP logo

xsahil03x / giffy_dialog Goto Github PK

View Code? Open in Web Editor NEW
653.0 15.0 125.0 15.94 MB

A Flutter package for a quick and handy giffy dialog.

Home Page: https://pub.dartlang.org/packages/giffy_dialog

License: MIT License

Kotlin 0.08% Dart 68.01% Swift 0.89% Objective-C 0.02% Ruby 1.75% CMake 12.23% C++ 14.88% C 0.93% HTML 1.20%
flutter flutter-package dart2 giffy-dialogs gifs material dialog animation flare-animation flare-flutter

giffy_dialog's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

giffy_dialog's Issues

cross-reference

Because every version of giffy_dialog depends on cached_network_image ^0.5.1 which depends on flutter_cache_manager ^0.2.0+1, every version of giffy_dialog requires flutter_cache_manager ^0.2.0+1.
And because flutter_cache_manager >=0.1.0-rc.1 <0.3.0-alpha depends on shared_preferences ^0.4.0, every version of giffy_dialog requires shared_preferences ^0.4.0.
So, because mobile_driver_app depends on both giffy_dialog ^1.2.0 and shared_preferences ^0.5.1+1, version solving failed.

I think the best way is not depend on any network plugin

How Could I add more than two options?

I have used the NetworkGiffyDialog Widget

I have tried to add customized options using children inside the widget like this:

children: <Widget>[
                 SimpleDialogOption(
                   onPressed: () {
                     Navigator.pop(context, "1");
                   },
                   child: const Text('Option ONE : 1'),
                 ),
                SimpleDialogOption(
                   onPressed: () {
                     Navigator.pop(context, "2");
                   },
                   child: const Text('Option ONE : 1'),
                 ),
          ],

but it appears that the widget doesn't support the children property, Is there a way to add other options rather than only "ok" and "cancel"?

`title` not mandatory

What do you think about making title not a mandatory parameter? When title is not provided it won't be shown on the widget, the reason for that is that sometime image could explain everything.

Any change introduce lottie version 3.0.0 ?

Is your feature request related to a problem? Please describe.

Hi Since Lottie version 3.0.0 introduce renderCache. Any change introduce new version of lottie in giffy dialog?

Describe the solution you'd like
introduct new version of lottie and support parameters maybe.

Describe alternatives you've considered
none

Additional context
none

Appreciate this awesome package.

New Feature: add support for RichText

current NetworkGiffyDialog implementation allows:
final Text title;
final Text description;

can these be modified to support
var text = new RichText( text: new TextSpan( // Note: Styles for TextSpans must be explicitly defined. // Child text spans will inherit styles from parent style: new TextStyle( fontSize: 14.0, color: Colors.black, ), children: <TextSpan>[ new TextSpan(text: 'Hello'), new TextSpan(text: 'World', style: new TextStyle(fontWeight: FontWeight.bold)), ], ), );

Compatibility with Flutter 1.5 and Dart 2.2.0

`file:///Users/USER/.pub-cache/hosted/pub.dartlang.org/flare_flutter-1.5.0/lib/flare.dart:1028:18: Error: The argument type 'Int32List' can't be assigned to the parameter type 'Uint16List'.

  • 'Int32List' is from 'dart:typed_data'.
  • 'Uint16List' is from 'dart:typed_data'.
    Try changing the type of the parameter, or casting the argument to 'Uint16List'.
    indices: _indices, textureCoordinates: _uvBuffer);`

Custom Body and title

Hey All

is there a way the parameters:

final Text title;
final Text description;

Are not burn as Text, and can be of the type widget?
so, we can have more flexibility?

Thanks,

Bottom Overflow in Landscape Mode

When the screen is in portrait mode, we get an error message of overflowing bottom pixels. This happens even in the sample app available.

How cancel button dismisses the dialog?

I use 'Navigator.of(context).pop();' once I get '200' statusCode from the server and immediately show the giffy dialog.

and I have another pop() in the dialog as follow:

onOkButtonPressed: () {
            Navigator.of(context).pop();
          },

when I press OK, I get the following error:

I/flutter (14881): Another exception was thrown: Instance of 'DiagnosticsProperty'

am guessing because the screen with the 'context' was already gone, however, when I press cancel, the dialog get dismissed, just how I want it to happen.

my question is, how can I dismiss the dialog when OK is pressed just like the Cancel button?

Add tests for dialogs in portrait mode and Assertion checks.

In order to increase the codecov report, we need to cover all the possible test cases.

  • - NetworkGiffyDialog test (Portrait mode)
  • - AssetGiffyDialog test (Portrait mode)
  • - FlareGiffyDialog test (Portrait mode)
  • - Test for covering all the possible asserts.

Looking up a deactivated widget's ancestor is unsafe.

At this point the state of the widget's element tree is no longer stable. To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling inheritFromWidgetOfExactType() in the widget's didChangeDependencies() method.

Default Title & Description & Image

Should there be default Title and Description?
I get that it sounds a bit weird at first but consider following situations where title can be empty:

  • Some dynamically generated dialogs where this could easily happen.
  • In case of mistake - if something goes wrong it is much better to display neutral title (or empty string) rahter than red screen of death.
  • Maybe somebody wants weird dialog box without any text - just some kind of image/animation

Also the case of null image could be handled better. Displaying nothing or some placeholder is better than crashing people's apps.

bug: build error due deprecated usage of RaisedButton

Material You (Material v3) has deprecated RaisedButton in favour of ElevatedButton

I am getting build errors due to the use of deprecated RaisedButton

/home/ashu/.pub-cache/hosted/pub.dev/giffy_dialog-1.8.0/lib/src/base_dialog.dart:203:13: Error: The method 'RaisedButton' isn't defined for the class '_BaseGiffyDialogState'.
- '_BaseGiffyDialogState' is from 'package:giffy_dialog/src/base_dialog.dart' ('/home/ashu/.pub-cache/hosted/pub.dev/giffy_dialog-1.8.0/lib/src/base_dialog.dart').
package:giffy_dialog/src/base_dialog.dart:1
Try correcting the name to the name of an existing method, or defining a method named 'RaisedButton'.
            RaisedButton(
            ^^^^^^^^^^^^
/home/ashu/.pub-cache/hosted/pub.dev/giffy_dialog-1.8.0/lib/src/base_dialog.dart:217:13: Error: The method 'RaisedButton' isn't defined for the class '_BaseGiffyDialogState'.
- '_BaseGiffyDialogState' is from 'package:giffy_dialog/src/base_dialog.dart' ('/home/ashu/.pub-cache/hosted/pub.dev/giffy_dialog-1.8.0/lib/src/base_dialog.dart').
package:giffy_dialog/src/base_dialog.dart:1
Try correcting the name to the name of an existing method, or defining a method named 'RaisedButton'.
            RaisedButton(
            ^^^^^^^^^^^^

AssetGiffyDialog and NetworkGiffyDialogg are the same

AssetGiffyDialog and NetworkGiffyDialog are exactly the same.
The only difference is that NetworkGiffyDialog accepts any Widget as image prop, while AssetGiffyDialog accepts only Image.
Perhaps it could be simplified somehow, e.g. one ImageGiffyDialog widget that can accept both Image.asset and Image.network. Actually, they return same type - Image, so it can be already done without any changes to logic.
One other option is make different constructors like ImageGiffyDialog.asset() and ImageGiffyDialog.network(). Although I don't think it is necessary at this point since Flutter's Image is handling all the asset vs network logic already.

Dialog without a button and will be dismiss programmatically

Hello,

I am a newbie. I have already a working code of a buttonless dialog and dismisses programmatically. Until I found this awesome package and I want to replace the dialog with giffy. How could I make a buttonless dialog and make this a function so I can just call in the future builder.

Below is my code for the dialog;
showAlertDialog(BuildContext context) { AlertDialog alert = AlertDialog( title: Text("Slow Internet Connection!"), content: Text("Your internet speed connection is too slow. " "Switch to Airplane mode to continue making transaction." ), );

showDialog(
  barrierDismissible: false,
  context: context,
  builder: (BuildContext context) {
    return alert;
  },
);

}`

And I can call this in the builder widget and dismiss using Navigator.of(context).pop(); on some condition.

How could I implement this using giffy_dialog. Thanks in advance.

customise the button

How can you customize the button...

e.g
change the name,
position the button vertically
Add new button

Upgrade Flutter v2.5

Hi, I am trying to upgrade to the latest version in flutter and got this error.

Because flare_loading 3.0.0 depends on flare_flutter ^3.0.0 and no versions of flare_loading match >3.0.0 <4.0.0, flare_loading ^3.0.0 requires flare_flutter ^3.0.0.
And because giffy_dialog >=1.8.0 depends on flare_flutter ^2.0.5, giffy_dialog >=1.8.0 is incompatible with flare_loading ^3.0.0.
And because flare_splash_screen 4.0.0 depends on flare_loading ^3.0.0 and no versions of flare_splash_screen match >4.0.0 <5.0.0, giffy_dialog >=1.8.0 is incompatible with flare_splash_screen ^4.0.0.
So, because accetera depends on both flare_splash_screen ^4.0.0 and giffy_dialog ^1.8.0, version solving failed.
pub get failed (1; So, because accetera depends on both flare_splash_screen ^4.0.0 and giffy_dialog ^1.8.0, version solving failed.)

How Can I dismiss dialog on OK button.

showDialog(
context: context,
builder: (_) => AssetGiffyDialog(
image: Image.asset(
'assets/notification.gif',
fit: BoxFit.cover,
),
title: Text(
'Notification Created',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 22.0, fontWeight: FontWeight.w600),
),
entryAnimation: EntryAnimation.DEFAULT,
description: Text(
'We will be notifyig you sooner. Please be on touch.',
textAlign: TextAlign.center,
style: TextStyle(),
),
onlyOkButton: true,
onOkButtonPressed: () => Navigator.of(context).pop(),
));

This will navigate to previous page instead of dismissing dialog.

TextAlign doesn't affect the title

TextAlign for title text doesn't do anything, it can be start or end - nothing changes, it always stays in the center.
I suggest

  • either remove it from example (since textAlign: TextAlign.center, doesn't affect anything)
  • or handle title alignment properly.

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.