You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, this is not an issue. Need some help.
Hello, I am using this package after a long, updated from v0.15.0 (flutter_bloc).
I have an older application that was using 0.15.0, I updated dependency to 2.0.0 (bloc) and 2.1.1 (flutter_bloc).
Now, I get warnings of closing the sinks (the bloc objects) (instances of dart.core.Sink). I know, this is USEFUL.
BUT, imagine below situation :
voidmain() {
BlocSupervisor.delegate =AppBlocDelegate();
MyBloc bloc1 =MyBloc();
bloc1.listen((state) {
if (state isProcessDone) {
// do some processing, and then...// runApp(MyApp());
}
});
bloc1.add(StartProcess());
}
Now, I get warning here, too. I can't close this bloc in void main() !!!
Moreover, I don't want to move this initialization logic into a widget. (To be honest, I have the code to initialize SharedPreferences in 'MyBloc1', so that preferences load before I show anything to user.)
Any suggestions?
The text was updated successfully, but these errors were encountered:
This is a duplicate of #587 and there is an issue open on the Dart Linter to resolve false positives at dart-lang/sdk#57882.
Regarding your specific question, I would either avoid creating streams and subscriptions directly in main because they will never be closed or you can simply disable the lint rule as is done within Flutter itself.
First of all, this is not an issue. Need some help.
Hello, I am using this package after a long, updated from v0.15.0 (flutter_bloc).
I have an older application that was using 0.15.0, I updated dependency to 2.0.0 (bloc) and 2.1.1 (flutter_bloc).
Now, I get warnings of closing the sinks (the bloc objects) (instances of dart.core.Sink). I know, this is USEFUL.
BUT, imagine below situation :
Now, I get warning here, too. I can't close this bloc in void main() !!!
Moreover, I don't want to move this initialization logic into a widget. (To be honest, I have the code to initialize SharedPreferences in 'MyBloc1', so that preferences load before I show anything to user.)
Any suggestions?
The text was updated successfully, but these errors were encountered: