Skip to content

Instantly share code, notes, and snippets.

@FlutterWiz
Created January 8, 2023 12:51
Show Gist options
  • Save FlutterWiz/980efdffa56b8fc9e5f2a67cb88d3455 to your computer and use it in GitHub Desktop.
Save FlutterWiz/980efdffa56b8fc9e5f2a67cb88d3455 to your computer and use it in GitHub Desktop.
part of 'chat_setup_cubit.dart';
@freezed
class ChatSetupState with _$ChatSetupState {
const factory ChatSetupState({
required ChatUserModel chatUser,
required ConnectionStatus webSocketConnectionStatus,
required bool isUserCheckedFromChatService,
}) = _ChatSetupState;
const ChatSetupState._();
factory ChatSetupState.empty() => ChatSetupState(
chatUser: ChatUserModel.empty(),
webSocketConnectionStatus: ConnectionStatus.disconnected,
isUserCheckedFromChatService: false,
);
bool get isChatUserConnected => chatUser != ChatUserModel.empty();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment