feat(chat): Layouts for chat select finished

This commit is contained in:
2024-04-22 12:46:36 +03:00
parent 35115a6dad
commit d549f01a23
8 changed files with 257 additions and 43 deletions

View File

@@ -2,6 +2,7 @@ import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import '/core/app_export.dart';
import 'package:eatvio_app/presentation/chat/chat_select_screen/models/chat_select_model.dart';
import 'package:eatvio_app/presentation/chat/chat_select_screen/models/chat_entry.dart'; // ignore: must_be_immutable
part 'chat_select_event.dart';
part 'chat_select_state.dart';
@@ -11,11 +12,38 @@ class ChatSelectBloc extends Bloc<ChatSelectEvent, ChatSelectState> {
on<ChatSelectInitialEvent>(_onInitialize);
}
List<ChatItemModel> fillChatEntryList() {
return [
ChatItemModel(
userImage: ImageConstant.imgLogo,
username: "Ксения Обрамова",
dateText: "9/29",
greetingText: "Привет, хорошая статья"),
ChatItemModel(
userImage: ImageConstant.imgLogo,
username: "Ксения Обрамова",
dateText: "9/29",
greetingText: "Привет, хорошая статья"),
ChatItemModel(
userImage: ImageConstant.imgLogo,
username: "Данил Иванов",
dateText: "9/29",
greetingText: "Посоветуй пожалуйста рецепт..."),
ChatItemModel(
userImage: ImageConstant.imgLogo,
username: "Данил Иванов",
dateText: "9/29",
greetingText: "Посоветуй пожалуйста рецепт...")
];
}
_onInitialize(
ChatSelectInitialEvent event,
Emitter<ChatSelectState> emit,
) async {
emit(state.copyWith(
chatSelectModelObj: state.chatSelectModelObj?.copyWith()));
chatSelectModelObj: state.chatSelectModelObj?.copyWith(
userprofileItemList: fillChatEntryList(),
)));
}
}