From 54c26df9cffbe0408f67ff93010ea31f9e20d07e Mon Sep 17 00:00:00 2001 From: Jayesh Nirve Date: Wed, 2 Feb 2022 13:07:33 +0530 Subject: [PATCH] fix: suggestions menu and use empty map in html messages null return --- lib/pages/chat/events/html_message.dart | 8 ++++---- lib/pages/chat/input_bar.dart | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pages/chat/events/html_message.dart b/lib/pages/chat/events/html_message.dart index 61e6c7b1..bb07150c 100644 --- a/lib/pages/chat/events/html_message.dart +++ b/lib/pages/chat/events/html_message.dart @@ -95,7 +95,7 @@ class HtmlMessage extends StatelessWidget { final identityParts = url.parseIdentifierIntoParts(); final identifier = identityParts?.primaryIdentifier; if (identifier == null) { - return {'': null}; + return {}; } if (identifier.sigil == '@') { // we have a user pill @@ -127,13 +127,13 @@ class HtmlMessage extends StatelessWidget { }; } } - return {'': null}; + return {}; } if (identifier.sigil == '!') { // we have a room ID pill final r = room.client.getRoomById(identifier); if (r == null) { - return {'': null}; + return {}; } return { 'displayname': @@ -141,7 +141,7 @@ class HtmlMessage extends StatelessWidget { 'avatar_url': r.getState('m.room.avatar')?.content['url'], }; } - return {'': null}; + return {}; }, ); } diff --git a/lib/pages/chat/input_bar.dart b/lib/pages/chat/input_bar.dart index a465673a..9a24b2d3 100644 --- a/lib/pages/chat/input_bar.dart +++ b/lib/pages/chat/input_bar.dart @@ -49,7 +49,7 @@ class InputBar extends StatelessWidget { } final searchText = controller!.text.substring(0, controller!.selection.baseOffset); - final List> ret = >[]; + final List> ret = >[]; const maxResults = 30; final commandMatch = RegExp(r'^\/([\w]*)$').firstMatch(searchText);