Documentation

My implementation

Got a warning by my IDE saying
Close instances ofdart.core.Sink``
The implementation should be correct based on the docs but there is waring.
Is the code violating anything? and if not, is there any plans to refactor to get rid of the warning?
Cheers
In this way, you're manually accessing your bloc. To solve this, dispose your provider by calling customerBloc?.close() in your dispose().
@momoDragon what you鈥檙e doing is perfectly fine and the warning is a false positive from the dart linter. There鈥檚 an open issue for this but in the meantime you can disable close_sinks in your analysis_options.yaml. You shouldn鈥檛 need to call close because BlocProvider does that for you.
See https://github.com/felangel/bloc/issues/587 for more details.
Thanks for the info @felangel
I found that getting state just once this would be ideal for my case.
CustomerState customerState = BlocProvider.of<CustomerBloc>(context).state;
@shaan-saz Calling .close() actually closes my bloc. so to get the bloc once and close it was not wise in my case.
Anyway thanks for the help