another-flushbar
another-flushbar copied to clipboard
Makes transition completer type nullable
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();
}
good work but can you please provide an example of how this error occurs ?