Fix null being on chat messages author temporarily
This commit is contained in:
parent
a40dd74b96
commit
6ca8f646b2
|
@ -81,7 +81,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||
title: const Text("Login"),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
|
|
@ -66,10 +66,9 @@ class _RoomPageState extends State<RoomPage> {
|
|||
itemCount: messages?.length,
|
||||
reverse: true,
|
||||
itemBuilder: (context, index) => ListTile(
|
||||
title: Text(messages![index]
|
||||
.senderFromMemoryOrFallback
|
||||
.displayName
|
||||
.toString()),
|
||||
title: Text(
|
||||
messages![index].senderFromMemoryOrFallback.displayName ??
|
||||
""),
|
||||
subtitle: Text(messages![index].body),
|
||||
leading:
|
||||
messages![index].senderFromMemoryOrFallback.avatarUrl !=
|
||||
|
@ -86,6 +85,7 @@ class _RoomPageState extends State<RoomPage> {
|
|||
),
|
||||
TextFormField(
|
||||
controller: chatController,
|
||||
textCapitalization: TextCapitalization.sentences,
|
||||
textInputAction: TextInputAction.send,
|
||||
decoration: const InputDecoration(hintText: 'Message'),
|
||||
onFieldSubmitted: (value) async {
|
||||
|
@ -109,7 +109,7 @@ class _RoomPageState extends State<RoomPage> {
|
|||
],
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: getChildren(),
|
||||
)),
|
||||
|
|
|
@ -78,7 +78,7 @@ class _RoomsPageState extends State<RoomsPage> {
|
|||
],
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(child: Consumer<ZenithClientProvider>(
|
||||
builder: (context, provider, child) {
|
||||
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();
|
||||
else
|
||||
return ListView.builder(
|
||||
|
|
Loading…
Reference in New Issue
Block a user