-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/532627 text reply #222
Closed
Closed
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
bc9d536
feat: adding reply container
RaulRodrigo06 f552219
chore: adding reply
RaulRodrigo06 a4bb774
fix: fixing color reply icon and text based on bubble color
RaulRodrigo06 786a9fd
Merge branch 'develop' into feature/532627-text-reply
RaulRodrigo06 5fa1696
fix: fixing padding and text overflow on ds reply container
RaulRodrigo06 5b28905
chore: removing empty line
RaulRodrigo06 cdaac63
fix: passing reply content to ds card
RaulRodrigo06 71d7247
fix: removing unused attributte
RaulRodrigo06 aef600d
Merge branch 'develop' into feature/532627-text-reply
RaulRodrigo06 ef5ab9c
fix: removing unecessary reply content and fixing return
RaulRodrigo06 8cf99be
Merge branch 'develop' into feature/532627-text-reply
cb0323c
fix: set manually extension for ppt
f441506
Merge branch 'develop' into feature/532627-text-reply
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:get/get.dart'; | ||
|
||
import '../../models/ds_message_item.model.dart'; | ||
|
||
class DSReplyController extends GetxController { | ||
final List<DSMessageItemModel> messages = []; | ||
|
||
void addMessages(List<DSMessageItemModel> newMessages) { | ||
messages.addAll(newMessages); | ||
} | ||
|
||
DSMessageItemModel? getMessageById(String id) { | ||
return messages.firstWhereOrNull((element) => element.id == id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ class DSFileMessageBubble extends StatelessWidget { | |
final List<DSBorderRadius> borderRadius; | ||
final DSMessageBubbleStyle style; | ||
final bool shouldAuthenticate; | ||
final String? replyId; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
/// Creates a Design System's [DSMessageBubble] used on files other than image, audio, or video | ||
DSFileMessageBubble({ | ||
|
@@ -30,6 +31,7 @@ class DSFileMessageBubble extends StatelessWidget { | |
required this.url, | ||
required this.size, | ||
required this.filename, | ||
this.replyId, | ||
this.borderRadius = const [DSBorderRadius.all], | ||
this.shouldAuthenticate = false, | ||
DSMessageBubbleStyle? style, | ||
|
@@ -46,6 +48,7 @@ class DSFileMessageBubble extends StatelessWidget { | |
), | ||
child: DSMessageBubble( | ||
borderRadius: borderRadius, | ||
replyId: replyId, | ||
padding: EdgeInsets.zero, | ||
align: align, | ||
style: style, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
import '../../controllers/chat/ds_reply.controller.dart'; | ||
import '../../enums/ds_align.enum.dart'; | ||
import '../../models/ds_message_bubble_style.model.dart'; | ||
import '../../themes/colors/ds_colors.theme.dart'; | ||
import '../../themes/icons/ds_icons.dart'; | ||
import '../../utils/ds_message_content_type.util.dart'; | ||
import '../texts/ds_body_text.widget.dart'; | ||
import '../texts/ds_caption_text.widget.dart'; | ||
|
||
class DSReplyContainer extends StatelessWidget { | ||
const DSReplyContainer({ | ||
super.key, | ||
required this.replyId, | ||
required this.style, | ||
required this.align, | ||
}); | ||
|
||
final DSAlign align; | ||
final String replyId; | ||
final DSMessageBubbleStyle style; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.all( | ||
8.0, | ||
), | ||
child: Column( | ||
children: [ | ||
Row( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
Icon( | ||
DSIcons.undo_outline, | ||
color: style.isLightBubbleBackground(align) | ||
? DSColors.neutralDarkCity | ||
: DSColors.neutralLightSnow, | ||
), | ||
const SizedBox(width: 8.0), | ||
DSCaptionText( | ||
'Reply', | ||
fontStyle: FontStyle.italic, | ||
color: style.isLightBubbleBackground(align) | ||
? DSColors.neutralDarkCity | ||
: DSColors.neutralLightSnow, | ||
), | ||
], | ||
), | ||
const SizedBox(height: 4.0), | ||
DecoratedBox( | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(4.0), | ||
border: Border.all( | ||
color: style.isLightBubbleBackground(align) | ||
? DSColors.contentGhost | ||
: DSColors.contentDisable, | ||
), | ||
color: style.isLightBubbleBackground(align) | ||
? DSColors.surface3 | ||
: DSColors.contentDefault, | ||
), | ||
child: IntrinsicHeight( | ||
child: Row( | ||
children: [ | ||
Container( | ||
decoration: const ShapeDecoration( | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.only( | ||
topLeft: Radius.circular(8.0), | ||
bottomLeft: Radius.circular(8.0), | ||
), | ||
), | ||
color: DSColors.primary, | ||
), | ||
width: 4.0, | ||
), | ||
Flexible( | ||
child: Padding( | ||
padding: const EdgeInsets.only( | ||
top: 8.0, | ||
left: 8.0, | ||
bottom: 8.0, | ||
), | ||
child: _replyWidget(replyId, style, align), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} | ||
|
||
Widget _replyWidget( | ||
String id, | ||
DSMessageBubbleStyle style, | ||
DSAlign align, | ||
) { | ||
final replyController = Get.find<DSReplyController>(); | ||
final message = replyController.getMessageById(id); | ||
|
||
switch (message?.type) { | ||
case DSMessageContentType.textPlain: | ||
return DSBodyText( | ||
message?.content is String ? message?.content : '**********', | ||
color: _color(align, style), | ||
overflow: TextOverflow.visible, | ||
); | ||
default: | ||
return Row( | ||
mainAxisSize: MainAxisSize.max, | ||
children: [ | ||
Icon( | ||
DSIcons.warning_outline, | ||
color: _color(align, style), | ||
), | ||
const SizedBox(width: 8.0), | ||
Flexible( | ||
child: DSBodyText( | ||
'Failed to load message', | ||
overflow: TextOverflow.visible, | ||
color: _color(align, style), | ||
), | ||
), | ||
], | ||
); | ||
} | ||
} | ||
|
||
Color _color(DSAlign align, DSMessageBubbleStyle style) { | ||
return style.isLightBubbleBackground(align) | ||
? DSColors.contentDefault | ||
: DSColors.surface1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reply with a audio is not correct in desk app