Hide "Group with" from room names

This commit is contained in:
Brandon Presley 2023-12-30 12:47:48 +13:00
parent 8ca788ccdd
commit 10b84d1521
2 changed files with 6 additions and 12 deletions

View File

@ -86,6 +86,7 @@ class _RoomPageState extends State<RoomPage> {
), ),
TextFormField( TextFormField(
controller: chatController, controller: chatController,
textInputAction: TextInputAction.send,
decoration: const InputDecoration(hintText: 'Message'), decoration: const InputDecoration(hintText: 'Message'),
onFieldSubmitted: (value) async { onFieldSubmitted: (value) async {
print("Sending text event $value to room ${widget.room.id}..."); print("Sending text event $value to room ${widget.room.id}...");
@ -101,7 +102,9 @@ class _RoomPageState extends State<RoomPage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary, backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.room.getLocalizedDisplayname()), title: Text(widget.room
.getLocalizedDisplayname()
.replaceFirst(RegExp("Group with "), "")),
actions: [ actions: [
IconButton(onPressed: setAvatar, icon: const Icon(Icons.image)) IconButton(onPressed: setAvatar, icon: const Icon(Icons.image))
], ],
@ -111,11 +114,6 @@ class _RoomPageState extends State<RoomPage> {
child: Column( child: Column(
children: getChildren(), children: getChildren(),
)), )),
floatingActionButton: FloatingActionButton(
onPressed: sendMessage,
tooltip: 'Send message',
child: const Icon(Icons.send),
),
); );
} }
} }

View File

@ -94,7 +94,8 @@ class _RoomsPageState extends State<RoomsPage> {
itemCount: provider.client.rooms.length, itemCount: provider.client.rooms.length,
itemBuilder: (context, index) => ListTile( itemBuilder: (context, index) => ListTile(
title: Text(provider.client.rooms[index] title: Text(provider.client.rooms[index]
.getLocalizedDisplayname()), .getLocalizedDisplayname()
.replaceFirst(RegExp("Group with "), "")),
leading: CircleAvatar( leading: CircleAvatar(
foregroundImage: NetworkImage(provider foregroundImage: NetworkImage(provider
.client.rooms[index].avatar .client.rooms[index].avatar
@ -107,11 +108,6 @@ class _RoomsPageState extends State<RoomsPage> {
}, },
)), )),
), ),
floatingActionButton: FloatingActionButton(
onPressed: sendMessage,
tooltip: 'Send message',
child: const Icon(Icons.send),
),
); );
} }
} }