forked from eatvio/eatvio_app
feat(chat): Classes added to chat screen
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user