Fix null being on chat messages author temporarily

This commit is contained in:
Brandon Presley 2023-12-30 14:44:35 +13:00
parent a40dd74b96
commit 6ca8f646b2
3 changed files with 8 additions and 8 deletions

View File

@ -81,7 +81,7 @@ class _LoginPageState extends State<LoginPage> {
title: const Text("Login"), title: const Text("Login"),
), ),
body: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

View File

@ -66,10 +66,9 @@ class _RoomPageState extends State<RoomPage> {
itemCount: messages?.length, itemCount: messages?.length,
reverse: true, reverse: true,
itemBuilder: (context, index) => ListTile( itemBuilder: (context, index) => ListTile(
title: Text(messages![index] title: Text(
.senderFromMemoryOrFallback messages![index].senderFromMemoryOrFallback.displayName ??
.displayName ""),
.toString()),
subtitle: Text(messages![index].body), subtitle: Text(messages![index].body),
leading: leading:
messages![index].senderFromMemoryOrFallback.avatarUrl != messages![index].senderFromMemoryOrFallback.avatarUrl !=
@ -86,6 +85,7 @@ class _RoomPageState extends State<RoomPage> {
), ),
TextFormField( TextFormField(
controller: chatController, controller: chatController,
textCapitalization: TextCapitalization.sentences,
textInputAction: TextInputAction.send, textInputAction: TextInputAction.send,
decoration: const InputDecoration(hintText: 'Message'), decoration: const InputDecoration(hintText: 'Message'),
onFieldSubmitted: (value) async { onFieldSubmitted: (value) async {
@ -109,7 +109,7 @@ class _RoomPageState extends State<RoomPage> {
], ],
), ),
body: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
children: getChildren(), children: getChildren(),
)), )),

View File

@ -78,7 +78,7 @@ class _RoomsPageState extends State<RoomsPage> {
], ],
), ),
body: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(8.0),
child: Center(child: Consumer<ZenithClientProvider>( child: Center(child: Consumer<ZenithClientProvider>(
builder: (context, provider, child) { builder: (context, provider, child) {
provider.client.onRoomState.stream.listen((event) { provider.client.onRoomState.stream.listen((event) {
@ -87,7 +87,7 @@ class _RoomsPageState extends State<RoomsPage> {
}); });
}); });
if (loadingRooms) if (provider.client.rooms.isEmpty)
return const CircularProgressIndicator(); return const CircularProgressIndicator();
else else
return ListView.builder( return ListView.builder(