refactor: Avoid unnecessary bool comparison
This commit is contained in:
parent
d08364688e
commit
1cd3a91037
15 changed files with 26 additions and 25 deletions
|
|
@ -168,9 +168,8 @@ class ChatListController extends State<ChatList>
|
|||
initialText: searchServer,
|
||||
keyboardType: TextInputType.url,
|
||||
autocorrect: false,
|
||||
validator: (server) => server.contains('.') == true
|
||||
? null
|
||||
: L10n.of(context).invalidServerName,
|
||||
validator: (server) =>
|
||||
server.contains('.') ? null : L10n.of(context).invalidServerName,
|
||||
);
|
||||
if (newServer == null) return;
|
||||
Matrix.of(context).store.setString(_serverStoreNamespace, newServer);
|
||||
|
|
@ -203,10 +202,9 @@ class ChatListController extends State<ChatList>
|
|||
|
||||
if (searchQuery.isValidMatrixId &&
|
||||
searchQuery.sigil == '#' &&
|
||||
roomSearchResult.chunk.any(
|
||||
(room) => room.canonicalAlias == searchQuery,
|
||||
) ==
|
||||
false) {
|
||||
!roomSearchResult.chunk.any(
|
||||
(room) => room.canonicalAlias == searchQuery,
|
||||
)) {
|
||||
final response = await client.getRoomIdByAlias(searchQuery);
|
||||
final roomId = response.roomId;
|
||||
if (roomId != null) {
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ extension on CachedPresence {
|
|||
? DateTime.now()
|
||||
: DateTime.fromMillisecondsSinceEpoch(0));
|
||||
|
||||
LinearGradient get gradient => presence.isOnline == true
|
||||
LinearGradient get gradient => presence.isOnline
|
||||
? LinearGradient(
|
||||
colors: [Colors.green, Colors.green.shade200, Colors.green.shade900],
|
||||
begin: Alignment.topLeft,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue