import 'package:freezed_annotation/freezed_annotation.dart'; part 'chat_state.freezed.dart'; @freezed class ChatState with _$ChatState { const factory ChatState.initial() = ChatInitial; const factory ChatState.loading() = ChatLoading; const factory ChatState.chatsLoaded(List chats) = _ChatsLoaded; const factory ChatState.chatSelected(String chat, List messages) = _ChatSelected; const factory ChatState.messagesLoaded(List messages) = _MessagesLoaded; const factory ChatState.messageSent() = _MessageSent; const factory ChatState.error(String message) = ChatError; }