Sunday, December 15, 2024
HomeiOS Developmentios - HydratedCubit for checking consumer onboarding state

ios – HydratedCubit for checking consumer onboarding state


I’m fairly new to cellular improvement. I have been working with Cubit and HydratedCubit to do a number of the state administration in my App. Primarily based on some the studying I have been doing HydratedCubit can be utilized to retailer shared settings in order that they get restored within the subsequent session. I have been attempting to determine how do that cleanly for Onboarding state of the appliance and I am a little bit confused. The appliance stream ought to go as follows:

If the consumer has by no means completed onboarding:

SplachPage() -> Onboarding() -> Login()

If the consumer has onboarded.

SplashPage() -> Login()

The SplashPage ought to at all times show the brand for two seconds.

I am attempting to determine the place my BlocProvider and BlocBuilder for the HydratedCutib ought to go. I may put it within the Onboarding web page and navigate to the Login instantly if the state exhibits that the consumer has onboarded up to now. The issue with that is that it will at all times make my app go to the onboarding web page when loading and that feels a bit pointless. However, I may put the supplier and builder within the Splash web page and never navigate to Onboarding if the consumer has Onboarded already however I do not need the consumer to attend 2 seconds within the SplashPage once more when the state modifications and I am undecided how I’d go about differencing if we’re loading SplashPage for the primary time or rebuilding it so this may occasionally result in the consumer having to attend one other 2 seconds within the SplashPage after onboarding.

Is there one thing I am not understanding or possibly HydratedCubit just isn’t match for this use case?

Thanks

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments