I am designing a Flutter workflow in which one user operation may require two sequential blockchain transactions.
The first transaction resets an existing token allowance. After it is confirmed, the application must verify current state and context, calculate a new fee, and ask the user to confirm the second transaction. Confirmation can take several minutes, the screen may close, and the application may restart between the two stages.
My current idea is to use a dedicated coordinator BLoC backed by durable storage. It would persist the operation context, both transaction hashes and their statuses, ignore stale asynchronous responses, and resume from the confirmed stage after restart. It must also prevent duplicate submissions and stop before the second transaction if the current context has changed.
Would you model this as one BLoC state machine with a durable workflow record, or as two independent transaction flows connected by an operation ID? How would you separate UI state, transaction polling, persistence, and retry logic without making the BLoC too large?
I would appreciate examples of similar recoverable multi-step workflows and alternative architectures used in Flutter applications.
Thank you for your help.