The issue was caused by the fact that the “(no project)” choice of the user was represented by the chosenProject variable in the ProjectSelectField.dart file being null. Since dismissing the dialog also caused null to be returned from the showDialog function, the dialog's barrierDismissible property was set to false to prevent bugs.
This PR adds a new private class called _ProjectChoice which is instead returned from the showDialog function. If it is null, then the dialog has been dismissed and the Bloc is not notified of any ProjectChangedEvent. Otherwise, the Bloc is notified of the _ProjectChoice's chosenProject property, which may be null in case the user selected the “(no project)” choice in the dialog.
This PR fixes #105.
The issue was caused by the fact that the “(no project)” choice of the user was represented by the
chosenProject
variable in theProjectSelectField.dart
file beingnull
. Since dismissing the dialog also causednull
to be returned from theshowDialog
function, the dialog'sbarrierDismissible
property was set tofalse
to prevent bugs.This PR adds a new private class called
_ProjectChoice
which is instead returned from theshowDialog
function. If it isnull
, then the dialog has been dismissed and theBloc
is not notified of anyProjectChangedEvent
. Otherwise, theBloc
is notified of the_ProjectChoice
'schosenProject
property, which may benull
in case the user selected the “(no project)” choice in the dialog.