mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-05-02 06:16:16 -04:00
more messages work
This commit is contained in:
parent
634543910b
commit
ff14969ffa
12 changed files with 226 additions and 192 deletions
|
@ -56,8 +56,8 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||
case AccountInfoStatus.accountLocked:
|
||||
return const HomeAccountLocked();
|
||||
case AccountInfoStatus.accountReady:
|
||||
return Provider.value(
|
||||
value: accountInfo.activeAccountInfo,
|
||||
return Provider<ActiveAccountInfo>.value(
|
||||
value: accountInfo.activeAccountInfo!,
|
||||
child: BlocProvider(
|
||||
create: (context) => AccountRecordCubit(
|
||||
record: accountInfo.activeAccountInfo!.accountRecord),
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../../chat/chat.dart';
|
||||
import '../../../tools/tools.dart';
|
||||
|
@ -31,10 +32,20 @@ class ChatOnlyPageState extends State<ChatOnlyPage>
|
|||
super.dispose();
|
||||
}
|
||||
|
||||
Widget buildChatComponent(BuildContext context) {
|
||||
final activeChatRemoteConversationKey =
|
||||
context.watch<ActiveChatCubit>().state;
|
||||
if (activeChatRemoteConversationKey == null) {
|
||||
return const EmptyChatWidget();
|
||||
}
|
||||
return ChatComponent.builder(
|
||||
remoteConversationRecordKey: activeChatRemoteConversationKey);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => SafeArea(
|
||||
child: GestureDetector(
|
||||
onTap: () => FocusScope.of(context).requestFocus(_unfocusNode),
|
||||
child: const ChatComponent(),
|
||||
child: buildChatComponent(context),
|
||||
));
|
||||
}
|
||||
|
|
|
@ -74,7 +74,15 @@ class HomeAccountReadyState extends State<HomeAccountReady>
|
|||
builder: (context) =>
|
||||
Material(color: Colors.transparent, child: buildUserPanel()));
|
||||
|
||||
Widget buildTabletRightPane(BuildContext context) => const ChatComponent();
|
||||
Widget buildTabletRightPane(BuildContext context) {
|
||||
final activeChatRemoteConversationKey =
|
||||
context.watch<ActiveChatCubit>().state;
|
||||
if (activeChatRemoteConversationKey == null) {
|
||||
return const EmptyChatWidget();
|
||||
}
|
||||
return ChatComponent.builder(
|
||||
remoteConversationRecordKey: activeChatRemoteConversationKey);
|
||||
}
|
||||
|
||||
// ignore: prefer_expression_function_bodies
|
||||
Widget buildTablet(BuildContext context) {
|
||||
|
@ -106,7 +114,7 @@ class HomeAccountReadyState extends State<HomeAccountReady>
|
|||
final accountData = context.watch<AccountRecordCubit>().state.data;
|
||||
|
||||
if (accountData == null) {
|
||||
return waitingPage(context);
|
||||
return waitingPage();
|
||||
}
|
||||
|
||||
return MultiBlocProvider(
|
||||
|
|
|
@ -143,7 +143,7 @@ class MainPagerState extends State<MainPager> with TickerProviderStateMixin {
|
|||
return _onNewChatBottomSheetBuilder(context);
|
||||
} else {
|
||||
// Unknown error
|
||||
return waitingPage(context);
|
||||
return debugPage('unknown page');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,5 +21,5 @@ class HomeNoActiveState extends State<HomeNoActive> {
|
|||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => waitingPage(context);
|
||||
Widget build(BuildContext context) => waitingPage();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue