Skip to content

Commit

Permalink
TW-2099: Update padding in chat
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev committed Oct 24, 2024
1 parent 6ac8fc4 commit 57ec515
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 25 deletions.
1 change: 0 additions & 1 deletion lib/pages/chat/chat_app_bar_title_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class ChatAppBarTitleStyle {
letterSpacing: ChatAppBarTitleStyle.letterSpacingRoomName,
);
static const avatarPadding = EdgeInsetsDirectional.only(
start: 4,
end: 8,
);
}
2 changes: 1 addition & 1 deletion lib/pages/chat/chat_event_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ChatEventList extends StatelessWidget {

@override
Widget build(BuildContext context) {
final horizontalPadding = TwakeThemes.isColumnMode(context) ? 8.0 : 0.0;
final horizontalPadding = TwakeThemes.isColumnMode(context) ? 16.0 : 0.0;

final events = controller.timeline!.events;
// create a map of eventId --> index to greatly improve performance of
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/chat_input_row_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ChatInputRowStyle {
static const double sendIconBtnSize = 44.0;

static const EdgeInsets sendIconPadding = EdgeInsets.only(
left: 8,
left: 12,
);

static EdgeInsetsDirectional contentPadding(BuildContext context) =>
Expand Down
1 change: 0 additions & 1 deletion lib/pages/chat/chat_input_row_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class ChatInputRowWeb extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(horizontal: 16),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: ChatInputRowStyle.chatInputRowBorderRadius,
Expand Down
5 changes: 2 additions & 3 deletions lib/pages/chat/chat_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,11 @@ class ChatView extends StatelessWidget with MessageContentMixin {
}

Widget _buildBackButton(BuildContext context) => Padding(
padding: const EdgeInsets.only(left: 12),
padding: const EdgeInsets.only(left: 8, right: 8),
child: TwakeIconButton(
tooltip: L10n.of(context)!.back,
icon: Icons.arrow_back_ios,
icon: Icons.chevron_left_outlined,
onTap: controller.onBackPress,
paddingAll: 8.0,
margin: const EdgeInsets.symmetric(vertical: 12.0),
),
);
Expand Down
5 changes: 3 additions & 2 deletions lib/pages/chat/chat_view_body_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:linagora_design_flutter/colors/linagora_sys_colors.dart';

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

static double bottomSheetPadding(BuildContext context) =>
TwakeThemes.isColumnMode(context) ? 16.0 : 8.0;

Expand All @@ -19,7 +20,7 @@ class ChatViewBodyStyle {
: LinagoraSysColors.material().onPrimary;

static EdgeInsets inputBarPadding(BuildContext context) => EdgeInsets.only(
left: 8.0,
right: responsive.isMobile(context) ? 16.0 : 8.0,
left: responsive.isMobile(context) ? 8.0 : 16.0,
right: responsive.isMobile(context) ? 8.0 : 16.0,
);
}
23 changes: 9 additions & 14 deletions lib/pages/chat/events/message/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class _MessageState extends State<Message> {
) {
return Container(
padding: EdgeInsets.only(
left: widget.selectMode ? 12.0 : 8.0,
left: Message.responsiveUtils.isMobile(context) ? 8.0 : 16.0,
),
color: widget.selected
? LinagoraSysColors.material().secondaryContainer
Expand All @@ -355,19 +355,14 @@ class _MessageState extends State<Message> {
if (widget.selectMode && event.status.isAvailable)
Align(
alignment: AlignmentDirectional.centerStart,
child: Padding(
padding: const EdgeInsetsDirectional.only(
start: 16.0,
),
child: Icon(
widget.selected
? Icons.check_circle_rounded
: Icons.circle_outlined,
color: widget.selected
? LinagoraSysColors.material().primary
: Colors.black,
size: 20,
),
child: Icon(
widget.selected
? Icons.check_circle_rounded
: Icons.circle_outlined,
color: widget.selected
? LinagoraSysColors.material().primary
: Colors.black,
size: 20,
),
),
Expanded(
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/events/message/message_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class MessageStyle {
);

static EdgeInsetsDirectional get paddingSwipeMessage =>
const EdgeInsetsDirectional.symmetric(horizontal: 12.0);
const EdgeInsetsDirectional.symmetric(horizontal: 16.0);

static EdgeInsetsDirectional get paddingDividerUnreadMessage =>
const EdgeInsetsDirectional.only(top: 16.0);
Expand Down
1 change: 0 additions & 1 deletion lib/pages/chat_draft/draft_chat_view_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class DraftChatViewStyle {

static EdgeInsetsGeometry get emptyChatChildrenPadding =>
const EdgeInsetsDirectional.only(
start: 4,
end: 8,
);
static const double emptyChatGapWidth = 12.0;
Expand Down

0 comments on commit 57ec515

Please sign in to comment.