I'm building a Flutter app with the null safety. I have a problem when I want to give a nullable variable to a function which can't accept a nullable one. I tried to check if it was null before calling the function but it doesn't work.
if (accountsFactory.selected != null){
_accountBloc?.select.add(accountsFactory.selected);
}
In this sample accountFactory.selected is the nullable one (Account?) and _accountBloc?.select is a StreamSink<Account>.
Does anyone know how I can make this work ? I would like to keep <Account> on my stream if possible.