Skip to content

Commit

Permalink
fix: update chat app bar web ui
Browse files Browse the repository at this point in the history
This Closes #488
  • Loading branch information
Julian KOUNE authored and hoangdat committed Aug 22, 2023
1 parent 5f6ffdf commit eb7bac3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
16 changes: 4 additions & 12 deletions lib/pages/chat/chat_app_bar_title.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ class ChatAppBarTitle extends StatelessWidget {
name: room!.getLocalizedDisplayname(
MatrixLocals(L10n.of(context)!),
),
size: ChatAppBarTitleStyle.avatarSize,
size: ChatAppBarTitleStyle.avatarSize(context),
),
),
),
],
),
const SizedBox(width: 12),
const SizedBox(width: 8.0),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand All @@ -93,11 +93,7 @@ class ChatAppBarTitle extends StatelessWidget {
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurface,
letterSpacing:
ChatAppBarTitleStyle.letterSpacingRoomName,
),
style: ChatAppBarTitleStyle.appBarTitleStyle(context),
),
_buildStatusContent(context, room!),
],
Expand All @@ -113,11 +109,7 @@ class ChatAppBarTitle extends StatelessWidget {
Room room,
) {
final TextStyle? statusTextStyle =
Theme.of(context).textTheme.labelSmall?.copyWith(
fontSize: 11,
color: Theme.of(context).colorScheme.tertiary,
letterSpacing: ChatAppBarTitleStyle.letterSpacingStatusContent,
);
ChatAppBarTitleStyle.statusTextStyle(context);

return StreamBuilder<ConnectivityResult>(
stream: getStreamInstance,
Expand Down
31 changes: 30 additions & 1 deletion lib/pages/chat/chat_app_bar_title_style.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,44 @@
import 'package:fluffychat/di/global/get_it_initializer.dart';
import 'package:fluffychat/utils/responsive/responsive_utils.dart';
import 'package:flutter/material.dart';
import 'package:linagora_design_flutter/linagora_design_flutter.dart';

class ChatAppBarTitleStyle {
static ResponsiveUtils responsive = getIt.get<ResponsiveUtils>();

static Color get currentlyActiveColor => const Color(0xFF5AD439);
static Color get currentlyInactiveColor => const Color(0xFF818C99);
static double get avatarFontSize => 15.0;
static double get avatarSize => 40.0;
static double avatarSize(BuildContext context) =>
responsive.isMobile(context) ? 40.0 : 48.0;

static double get statusSize => 15;
static Color get statusBorderColor => Colors.white;
static double get statusBorderSize => 2;

static double get letterSpacingRoomName => 0.15;
static double get letterSpacingStatusContent => 0.5;

static TextStyle? appBarTitleStyle(BuildContext context) =>
responsive.isMobile(context)
? Theme.of(context).textTheme.titleMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurface,
letterSpacing: ChatAppBarTitleStyle.letterSpacingRoomName,
)
: Theme.of(context).textTheme.titleLarge?.copyWith(
color: Theme.of(context).colorScheme.onSurface,
letterSpacing: ChatAppBarTitleStyle.letterSpacingRoomName,
);

static TextStyle? statusTextStyle(BuildContext context) =>
responsive.isMobile(context)
? Theme.of(context).textTheme.labelSmall?.copyWith(
fontSize: 11,
color: Theme.of(context).colorScheme.tertiary,
letterSpacing: ChatAppBarTitleStyle.letterSpacingStatusContent,
)
: Theme.of(context).textTheme.bodySmall?.copyWith(
color: LinagoraRefColors.material().neutral[50],
letterSpacing: ChatAppBarTitleStyle.letterSpacingRoomName,
);
}
1 change: 1 addition & 0 deletions lib/pages/chat/chat_view_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ChatViewStyle {
static EdgeInsetsDirectional paddingLeading(BuildContext context) =>
EdgeInsetsDirectional.only(
top: responsive.isMobile(context) ? 40 : 0,
start: responsive.isMobile(context) ? 0 : 16,
);

static EdgeInsetsDirectional paddingBanner(BuildContext context) =>
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat_draft/draft_chat_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class _EmptyChatTitle extends StatelessWidget {
name: snapshot.data?.displayName ??
displayName ??
receiverId,
size: ChatAppBarTitleStyle.avatarSize,
size: ChatAppBarTitleStyle.avatarSize(context),
),
),
),
Expand Down

0 comments on commit eb7bac3

Please sign in to comment.