cmdrootaccess / another-flushbar

A flexible widget for user notification. Customize your text, button, duration, animations and much more. For Android devs, it is made to replace Snackbars and Toasts.
https://pub.dev/packages/another_flushbar
MIT License
145 stars 88 forks source link

Makes transition completer type nullable #92

Open jfacoustic opened 1 year ago

jfacoustic commented 1 year ago

This PR fixes the following error:

When I try to show the flushbar before popping to another route, I get the exception:

_TypeError (type 'Null' is not a subtype of type 'FutureOr<String>')

This occurs in the dispose method in the FlushbarRoute. At that point, I'm trying to dispose of a flushbar of type <String>, but _result is null:

   @override
  void dispose() {
    assert(!_transitionCompleter.isCompleted,
        'Cannot dispose a $runtimeType twice.');
    _controller?.dispose();
    _transitionCompleter.complete(_result);
    super.dispose();
  }
cmdrootaccess commented 1 year ago

good work but can you please provide an example of how this error occurs ?