feat(chat): Classes added to chat screen

This commit is contained in:
2024-04-04 13:28:15 +03:00
parent 28d6525c78
commit 8386bcf137
5 changed files with 115 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import '/core/app_export.dart';
import 'package:eatvio_app/presentation/chat/chat_screen/models/chat_model.dart';
part 'chat_event.dart';
part 'chat_state.dart';
/// A bloc that manages the state of a Chat according to the event that is dispatched to it.
class ChatBloc extends Bloc<ChatEvent, ChatState> {
ChatBloc(ChatState initialState) : super(initialState) {
on<ChatInitialEvent>(_onInitialize);
}
_onInitialize(
ChatInitialEvent event,
Emitter<ChatState> emit,
) async {
emit(state.copyWith(chatModelObj: state.chatModelObj?.copyWith()));
}
}