feat(chat): Cheatroom layouts and API data load

This commit is contained in:
2024-05-03 13:20:52 +03:00
parent c8a612186e
commit 6869287c85
3 changed files with 123 additions and 55 deletions

View File

@@ -3,8 +3,26 @@
part of 'chat_bloc.dart';
/// Represents the state of Chat in the application.
///
class ChatState extends Equatable {
ChatState({
this.chatModelObj,
});
ChatModel? chatModelObj;
@override
List<Object?> get props => [chatModelObj];
ChatState copyWith({ChatModel? chatModelObj}) {
return ChatState(
chatModelObj: chatModelObj ?? this.chatModelObj,
);
}
}
class ChatLoadedState extends ChatState {
ChatLoadedState({
this.selectedDropDownValue,
this.chatModelObj,
});
@@ -23,9 +41,21 @@ class ChatState extends Equatable {
ChatModel? chatModelObj,
}) {
return ChatState(
selectedDropDownValue:
selectedDropDownValue ?? this.selectedDropDownValue,
chatModelObj: chatModelObj ?? this.chatModelObj,
);
}
}
class ChatErrorState extends ChatState {
final String errorMessage;
ChatErrorState(this.errorMessage);
@override
List<Object> get props => [errorMessage];
}
class ChatInitialState extends ChatState {
ChatInitialState({required ChatModel chatModelObj})
: super(chatModelObj: chatModelObj);
}