fix: Update typing

This commit is contained in:
Christian Pauly 2020-12-17 19:14:33 +01:00
parent 6271316fcc
commit 3d70b1efbf

View File

@ -521,59 +521,60 @@ class _ChatState extends State<_Chat> {
titleSpacing: 0, titleSpacing: 0,
title: selectedEvents.isEmpty title: selectedEvents.isEmpty
? StreamBuilder<Object>( ? StreamBuilder<Object>(
stream: Matrix.of(context) stream: room.onUpdate.stream,
.client builder: (context, snapshot) => ListTile(
.onPresence leading: Avatar(room.avatar, room.displayname),
.stream contentPadding: EdgeInsets.zero,
.where((p) => p.senderId == room.directChatMatrixID), onTap: room.isDirectChat
builder: (context, snapshot) { ? () => showModalBottomSheet(
return ListTile( context: context,
leading: Avatar(room.avatar, room.displayname), builder: (context) => UserBottomSheet(
contentPadding: EdgeInsets.zero, user: room.getUserByMXIDSync(
onTap: room.isDirectChat room.directChatMatrixID),
? () => showModalBottomSheet( onMention: () => sendController.text +=
context: context, ' ${room.directChatMatrixID}',
builder: (context) => UserBottomSheet( ),
user: room )
.getUserByMXIDSync(room.directChatMatrixID), : () => Navigator.of(context).push(
onMention: () => sendController.text += AppRoute.defaultRoute(
' ${room.directChatMatrixID}', context,
), ChatDetails(room),
)
: () => Navigator.of(context).push(
AppRoute.defaultRoute(
context,
ChatDetails(room),
),
),
title: Text(
room.getLocalizedDisplayname(
MatrixLocals(L10n.of(context))),
maxLines: 1),
subtitle: typingText.isEmpty
? Text(
room.getLocalizedStatus(context),
maxLines: 1,
)
: Row(
children: <Widget>[
Icon(Icons.edit_outlined,
color: Theme.of(context).primaryColor,
size: 13),
SizedBox(width: 4),
Text(
typingText,
maxLines: 1,
style: TextStyle(
color: Theme.of(context).primaryColor,
fontStyle: FontStyle.italic,
fontSize: 16,
), ),
), ),
], title: Text(
), room.getLocalizedDisplayname(
); MatrixLocals(L10n.of(context))),
}) maxLines: 1),
subtitle: typingText.isEmpty
? StreamBuilder<Object>(
stream: Matrix.of(context)
.client
.onPresence
.stream
.where((p) =>
p.senderId == room.directChatMatrixID),
builder: (context, snapshot) => Text(
room.getLocalizedStatus(context),
maxLines: 1,
))
: Row(
children: <Widget>[
Icon(Icons.edit_outlined,
color: Theme.of(context).primaryColor,
size: 13),
SizedBox(width: 4),
Text(
typingText,
maxLines: 1,
style: TextStyle(
color: Theme.of(context).primaryColor,
fontStyle: FontStyle.italic,
fontSize: 16,
),
),
],
),
))
: Text(L10n.of(context) : Text(L10n.of(context)
.numberSelected(selectedEvents.length.toString())), .numberSelected(selectedEvents.length.toString())),
actions: selectMode actions: selectMode