Skip to content

Commit

Permalink
TW-877: Encrypted Icon before display name
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian KOUNE authored and hoangdat committed Nov 1, 2023
1 parent 0f82700 commit 157884e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 7 deletions.
7 changes: 7 additions & 0 deletions assets/images/ic_encrypted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 24 additions & 7 deletions lib/pages/chat/chat_app_bar_title.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions lib/pages/chat_list/chat_list_item_title.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions lib/resource/image_paths.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 157884e

Please sign in to comment.