messages work

This commit is contained in:
Christien Rioux 2024-02-11 00:29:58 -05:00
parent 43dbf26cc0
commit 634543910b
47 changed files with 2206 additions and 123 deletions

View file

@ -1,3 +1,4 @@
import 'package:async_tools/async_tools.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@ -24,7 +25,9 @@ class ChatSingleContactItemWidget extends StatelessWidget {
final scale = theme.extension<ScaleScheme>()!;
final activeChatCubit = context.watch<ActiveChatCubit>();
final activeConversationsCubit = context.watch<ActiveConversationsCubit>();
// final activeConversation = context.select<ActiveConversationsCubit, >();
// final activeConversationMessagesCubit =
// context.watch<ActiveConversationMessagesCubit>(); xxx does this need to be here?
final remoteConversationRecordKey =
proto.TypedKeyProto.fromProto(_contact.remoteConversationRecordKey);
@ -69,9 +72,13 @@ class ChatSingleContactItemWidget extends StatelessWidget {
// component is not dragged.
child: ListTile(
onTap: () {
xxx deal with async
activeConversationsCubit.addConversation(contact: _contact);
activeChatCubit.setActiveChat(remoteConversationRecordKey);
final activeConversationsCubit =
context.read<ActiveConversationsCubit>();
singleFuture(activeChatCubit, () async {
await activeConversationsCubit.addConversation(
contact: _contact);
activeChatCubit.setActiveChat(remoteConversationRecordKey);
});
},
title: Text(_contact.editedProfile.name),

View file

@ -10,8 +10,6 @@ import '../../proto/proto.dart' as proto;
import '../../theme/theme.dart';
import '../../tools/tools.dart';
import '../chat_list.dart';
import 'chat_single_contact_item_widget.dart';
import 'empty_chat_list_widget.dart';
class ChatSingleContactListWidget extends StatelessWidget {
const ChatSingleContactListWidget({super.key});