another-flushbar icon indicating copy to clipboard operation
another-flushbar copied to clipboard

Makes transition completer type nullable

Open jfacoustic opened this issue 2 years ago • 1 comments

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();
 }

jfacoustic avatar Dec 28 '22 00:12 jfacoustic

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

cmdrootaccess avatar May 09 '23 13:05 cmdrootaccess