Reputation: 1
I have a feedback screen. The themes for this form are loaded with a separate query. I understand correctly that when using any state manager, in this case Cubit I have to give up setState() and create 3 Cubit:
If you do everything as I wrote above (create 3 cubit) then wouldn’t it be redundant work?
Upvotes: 0
Views: 318
Reputation: 2541
Indeed, the description looks like redundant work.
the first two points must be in the same qubit. you use the same data that you received, displayed to the user, and handle the user's interaction with them. it is logical that this is one сubit.
sending messages should preferably be in another сubit if:
if in the third point you send data, such as the theme selected by the user, then this should also definitely be in the same qubit. but even if this is other data, but sending messages is ONLY on this screen, then this logic may well live in this qubit too.
Upvotes: 0