Closed behlsoft closed 3 years ago
my actual condition is :- i have camera controller in my view model which i want to dispose as soon as user go back ...so where should i do that.. thanks for support!
Hey any update?
Still no response?
hello @behlsoft base view has a dispose options, and you can call your dispose custom method from viewmodel and that's fine, for example:
return BaseView
But you need some changes from base view and try to implement like this
class BaseView
const BaseView( {Key? key, required this.builder, required this.model, required this.onModelReady, this.dispose, this.onRefresh}) : super(key: key);
@override
_BaseViewState
Now, you can able to everyting in dispose method. this method work both state and viewmodel;
am using baseview for my view ... init and setcontext is working fine ... how dispose will work? i want to dispose my controllers (initialised in viewmodel) when i move to other screen.. how it is possible?