build method
- ChatParams params
Implementation
@override
ChatState build(ChatParams params) {
_sessionId = null;
_sessionStartedAt = null;
_endedSessionId = null;
// Start restoring immediately so the first build() already shows a spinner
// instead of flashing the empty/onboarding state.
if (params.topicId != null) {
Future.microtask(() => restoreSession());
}
return ChatState(isRestoring: params.topicId != null);
}