forked from eatvio/eatvio_app
feat(chat): Cheatroom layouts and API data load
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user