mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-12-15 16:29:10 -05:00
messages work
This commit is contained in:
parent
43dbf26cc0
commit
634543910b
47 changed files with 2206 additions and 123 deletions
|
|
@ -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),
|
||||
|
||||
|
|
|
|||
|
|
@ -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});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue