diff --git a/assets/images/ic_encrypted.svg b/assets/images/ic_encrypted.svg new file mode 100644 index 0000000000..f082a53915 --- /dev/null +++ b/assets/images/ic_encrypted.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/lib/pages/chat/chat_app_bar_title.dart b/lib/pages/chat/chat_app_bar_title.dart index 2fc56377fb..8939af511d 100644 --- a/lib/pages/chat/chat_app_bar_title.dart +++ b/lib/pages/chat/chat_app_bar_title.dart @@ -1,10 +1,12 @@ import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:fluffychat/pages/chat/chat_app_bar_title_style.dart'; +import 'package:fluffychat/resource/image_paths.dart'; import 'package:fluffychat/utils/common_helper.dart'; import 'package:fluffychat/utils/room_status_extension.dart'; import 'package:fluffychat/utils/string_extension.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:lottie/lottie.dart'; import 'package:matrix/matrix.dart'; import 'package:fluffychat/pages/user_bottom_sheet/user_bottom_sheet.dart'; @@ -91,14 +93,29 @@ class ChatAppBarTitle extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - roomName ?? - room!.getLocalizedDisplayname( - MatrixLocals(L10n.of(context)!), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + if (room?.encrypted == true) + Padding( + padding: const EdgeInsets.all(2.0), + child: SvgPicture.asset( + ImagePaths.icEncrypted, + width: 20, + height: 20, + ), ), - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: ChatAppBarTitleStyle.appBarTitleStyle(context), + Text( + roomName ?? + room!.getLocalizedDisplayname( + MatrixLocals(L10n.of(context)!), + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: ChatAppBarTitleStyle.appBarTitleStyle(context), + ), + ], ), _ChatAppBarStatusContent( connectivityResultStream: connectivityResultStream, diff --git a/lib/pages/chat_list/chat_list_item_title.dart b/lib/pages/chat_list/chat_list_item_title.dart index 704d9ba056..e5ad76ce8d 100644 --- a/lib/pages/chat_list/chat_list_item_title.dart +++ b/lib/pages/chat_list/chat_list_item_title.dart @@ -2,11 +2,13 @@ import 'package:fluffychat/pages/chat_list/chat_list_item_title_style.dart'; import 'package:fluffychat/presentation/decorators/chat_list/title_text_style_decorator/title_text_style_view.dart'; import 'package:fluffychat/presentation/mixins/chat_list_item_mixin.dart'; import 'package:fluffychat/pages/chat_list/chat_list_item_style.dart'; +import 'package:fluffychat/resource/image_paths.dart'; import 'package:fluffychat/utils/date_time_extension.dart'; import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart'; import 'package:fluffychat/utils/room_status_extension.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:linagora_design_flutter/linagora_design_flutter.dart'; import 'package:matrix/matrix.dart'; @@ -29,6 +31,16 @@ class ChatListItemTitle extends StatelessWidget with ChatListItemMixin { children: [ Row( children: [ + if (room.encrypted) + Padding( + padding: + const EdgeInsets.only(right: 4, top: 2, bottom: 2), + child: SvgPicture.asset( + ImagePaths.icEncrypted, + width: 20, + height: 20, + ), + ), Flexible( child: Text( displayName, diff --git a/lib/resource/image_paths.dart b/lib/resource/image_paths.dart index a7c5c24056..2c6ad3afee 100644 --- a/lib/resource/image_paths.dart +++ b/lib/resource/image_paths.dart @@ -37,6 +37,7 @@ class ImagePaths { _getImagePath('ic_error_page_background.svg'); static String get icNoResultsFound => _getImagePath('ic_no_results_found.svg'); + static String get icEncrypted => _getImagePath('ic_encrypted.svg'); static String _getImagePath(String imageName) { return AssetsPaths.images + imageName;