Skip to content

Commit

Permalink
Fixed a small issue in message container
Browse files Browse the repository at this point in the history
  • Loading branch information
fayeed committed Oct 22, 2019
1 parent 397502a commit deb608a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.0.8]

- Made the default avatar responsive for the current user.

## [1.0.7]

- Made the default avatar responsive.
Expand Down
26 changes: 19 additions & 7 deletions lib/src/message_listview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class _MessageListViewState extends State<MessageListView> {
widget.messages[i].user.uid == widget.user.uid
? MainAxisAlignment.end
: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Padding(
padding: EdgeInsets.symmetric(
Expand All @@ -194,9 +194,13 @@ class _MessageListViewState extends State<MessageListView> {
avatarBuilder: widget.avatarBuilder,
)
: SizedBox(
width:
MediaQuery.of(context).size.width *
0.08,
width: widget.messages[i].user.uid !=
widget.user.uid
? MediaQuery.of(context)
.size
.width *
0.08
: 0.0,
),
),
GestureDetector(
Expand Down Expand Up @@ -250,8 +254,10 @@ class _MessageListViewState extends State<MessageListView> {
),
if (widget.showuserAvatar)
Padding(
padding:
EdgeInsets.symmetric(horizontal: 10.0),
padding: EdgeInsets.symmetric(
horizontal:
MediaQuery.of(context).size.width *
0.02),
child: ((widget.showAvatarForEverMessage ||
showAvatar) &&
widget.messages[i].user.uid ==
Expand All @@ -263,7 +269,13 @@ class _MessageListViewState extends State<MessageListView> {
avatarBuilder: widget.avatarBuilder,
)
: SizedBox(
width: 40.0,
width: widget.messages[i].user.uid ==
widget.user.uid
? MediaQuery.of(context)
.size
.width *
0.08
: 0.0,
),
)
else
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dash_chat
description: The most complete Chat UI for flutter inspired by react-native-gifted-chat.
version: 1.0.7
version: 1.0.8
author: "fayeed <[email protected]>"
homepage: https://github.com/fayeed/dash_chat

Expand Down

0 comments on commit deb608a

Please sign in to comment.