From e54b96a35190cb71e89be60e2c2ba34786a9eefd Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 12 Mar 2020 20:58:53 +0100 Subject: [PATCH] hotfix message ui overflow --- CHANGELOG.md | 4 ++++ lib/src/message_input.dart | 1 + lib/src/message_widget.dart | 22 +++++++++++++++------- lib/src/reaction_picker.dart | 2 +- pubspec.yaml | 6 +++--- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92295176..e4b7ea55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.9 + +- Fix message ui overflow + ## 0.1.8 - Bug fix diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index 2c45d7a2..0bb8cc31 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -502,6 +502,7 @@ class _MessageInputState extends State { ), ), context: context, + isScrollControlled: true, builder: (_) { return Column( mainAxisSize: MainAxisSize.min, diff --git a/lib/src/message_widget.dart b/lib/src/message_widget.dart index 4e3cc042..1b9a688d 100644 --- a/lib/src/message_widget.dart +++ b/lib/src/message_widget.dart @@ -404,7 +404,8 @@ class _MessageWidgetState extends State borderRadius: boxDecoration.borderRadius, child: Container( decoration: boxDecoration, - constraints: BoxConstraints.loose(Size.fromWidth(300)), + constraints: BoxConstraints.loose( + Size.fromWidth(MediaQuery.of(context).size.width * 0.7)), child: Stack( children: [ Column( @@ -447,7 +448,8 @@ class _MessageWidgetState extends State decoration: _buildBoxDecoration(_isLastUser || nOfAttachmentWidgets > 0), padding: EdgeInsets.all(10), - constraints: BoxConstraints.loose(Size.fromWidth(300)), + constraints: BoxConstraints.loose( + Size.fromWidth(MediaQuery.of(context).size.width * 0.7)), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -571,7 +573,12 @@ class _MessageWidgetState extends State } }, child: Container( - constraints: BoxConstraints.loose(Size(300, 500)), + constraints: BoxConstraints.loose( + Size( + MediaQuery.of(context).size.width * 0.7, + 500, + ), + ), child: Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -582,7 +589,7 @@ class _MessageWidgetState extends State attachment.title, overflow: TextOverflow.ellipsis, style: _messageTheme.messageText.copyWith( - color: Colors.blue, + color: StreamChatTheme.of(context).accentColor, fontWeight: FontWeight.bold, ), ), @@ -658,7 +665,7 @@ class _MessageWidgetState extends State _isMyMessage ? FlatButton( child: Padding( - padding: const EdgeInsets.all(28.0), + padding: const EdgeInsets.all(16.0), child: Text( 'Delete message', style: theme.textTheme.headline @@ -677,7 +684,7 @@ class _MessageWidgetState extends State _isMyMessage ? FlatButton( child: Padding( - padding: const EdgeInsets.all(28.0), + padding: const EdgeInsets.all(16.0), child: Text( 'Edit message', style: theme.textTheme.headline, @@ -696,7 +703,7 @@ class _MessageWidgetState extends State !widget.isParent) ? FlatButton( child: Padding( - padding: const EdgeInsets.all(28.0), + padding: const EdgeInsets.all(16.0), child: Text( 'Start a thread', style: theme.textTheme.headline, @@ -719,6 +726,7 @@ class _MessageWidgetState extends State context: context, elevation: 2, clipBehavior: Clip.hardEdge, + isScrollControlled: true, shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.circular(32), diff --git a/lib/src/reaction_picker.dart b/lib/src/reaction_picker.dart index eed494a6..221dd3d8 100644 --- a/lib/src/reaction_picker.dart +++ b/lib/src/reaction_picker.dart @@ -14,7 +14,7 @@ class ReactionPicker extends StatelessWidget { @required this.reactionToEmoji, @required this.message, @required this.channel, - this.size = 40, + this.size = 30, }) : super(key: key); final Map reactionToEmoji; diff --git a/pubspec.yaml b/pubspec.yaml index 28aa55ba..b7c2cdf9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: stream_chat_flutter homepage: https://github.com/GetStream/stream-chat-flutter description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter. -version: 0.1.8 +version: 0.1.9 environment: sdk: ">=2.3.0 <3.0.0" @@ -11,7 +11,7 @@ dependencies: sdk: flutter rxdart: ^0.23.1 flutter_widgets: ^0.1.11 - jiffy: ^3.0.0 + jiffy: ^3.0.1 cached_network_image: ^2.0.0 flutter_markdown: ^0.3.4 url_launcher: ^5.4.2 @@ -20,7 +20,7 @@ dependencies: file_picker: ^1.4.3+2 image_picker: ^0.6.3+4 keyboard_visibility: ^0.5.6 - stream_chat: ^0.1.18 + stream_chat: ^0.1.19 dev_dependencies: pedantic: ^1.9.0