Skip to content

Commit

Permalink
fix:🐛Reaction widget gets cutOff when it width is greater then messag…
Browse files Browse the repository at this point in the history
…e width for the image message type.
  • Loading branch information
jaiminrana05 authored and apurva010 committed May 14, 2024
1 parent 06d5457 commit 9ad42b4
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 21 deletions.
43 changes: 25 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,77 @@
## [1.4.0] (UnReleased)

* **Fix**: [124](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/124)Reaction widget
gets cutOff when it width is greater then message width for the Image
message type.

## [1.3.1]

* **Feat**: [105](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/105) Allow user
to get callback when image is picked so user can perform operation like crop. Allow user to pass
* **Feat**: [105](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/105) Allow user
to get callback when image is picked so user can perform operation like crop. Allow user to pass
configuration like height, width, image quality and preferredCameraDevice.
* **Fix**: [95](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/95) Fix issue of
* **Fix**: [95](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/95) Fix issue of
chat is added to bottom while `loadMoreData` callback.
* **Fix**: [109](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/109) Added
support for the hiding/Un-hiding gallery and camera buttons
* **Fix**: [109](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/109) Added
support for the hiding/Un-hiding gallery and camera buttons

## [1.3.0]

* **Feat**: [71](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/71) Added Callback
when a user starts/stops composing typing a message.
* **Fix**: [78](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/78) Fix issue of
unmodifiable list.
* **Feat**: [76](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/76) Message Receipts.
* **Feat**: [76](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/76) Message
Receipts.
* **Fix**: [81](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/81) Fix issue of
TypingIndicator Rebuilding ChatView.
* **Fix**: [94](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/94) Fixed deprecated
`showRecentsTab` property with new `recentTabBehavior`.
* Support for latest flutter version `3.10.5`.
* Update dependencies `http` to version `1.1.0` and `image_picker` to version range `'>=0.8.9 <2.0.0'`.

* Update dependencies `http` to version `1.1.0` and `image_picker` to version
range `'>=0.8.9 <2.0.0'`.

## [1.2.1]

* **Fix**: [60](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/60) Fix image from
file is not loaded.
* **Fix**: [61](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/61) Fix issue of
audio message is not working.
* **Feat**: [65](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/65) Add callback
* **Feat**: [65](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/65) Add callback
when user react on message.


## [1.2.0+1]

* **Feat**: [42](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/42) Ability to
* **Feat**: [42](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/42) Ability to
get callback on tap of profile circle avatar.
* **Breaking**: Add `messageType` in `onSendTap` callback for encountering messages.
* **Breaking**: Remove `onRecordingComplete` and you can get Recorded audio in `onSendTap` callback
with `messageType`.
* **Breaking**: Remove `onImageSelected` from `ImagePickerIconsConfiguration` and can get selected
image in `onSendTap` callback with `messageType`.
* **Feat**: [49](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/49) Add `onUrlDetect`
* **Feat**: [49](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/49)
Add `onUrlDetect`
callback for opening urls.
* **Feat**: [51](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/51) Ability to
get callback on long press of profile circle avatar.

## [1.1.0]

* **Feat**: [37](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/37) Ability to
* **Feat**: [37](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/37) Ability to
enable or disable specific features.
* **Feat**: [34](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/34) Ability to
add voice message.
* **Breaking**: Remove `onEmojiTap` from `ReactionPopupConfiguration`, it can be handled internally.
* **Breaking**: Remove `horizontalDragToShowMessageTime` from `ChatBackgroundConfiguration` and
* **Breaking**: Remove `horizontalDragToShowMessageTime` from `ChatBackgroundConfiguration` and
add `enableSwipeToSeeTime` parameter with same feature in `FeatureActiveConfig`.
* **Breaking**: Remove `showReceiverProfileCircle` and add `enableOtherUserProfileAvatar` parameter
with same feature in `FeatureActiveConfig`.
* * **Breaking**: Move `enablePagination` parameter from `ChatView` to `FeatureActiveConfig`.
* **Breaking**: Move `enablePagination` parameter from `ChatView` to `FeatureActiveConfig`.

## [1.0.1]

* **Fix**: [32](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/32) Fix issue of
* **Fix**: [32](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/32) Fix issue of
while replying to image it highlights the link instead of the image.
* **Fix**: [35](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/35) Fix issue of
* **Fix**: [35](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/35) Fix issue of
removing reaction which is reacted accidentally.

## [1.0.0+1]
Expand Down
6 changes: 6 additions & 0 deletions lib/src/models/message_reaction_configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import 'package:chatview/src/utils/constants/constants.dart';
import 'package:flutter/material.dart';

class MessageReactionConfiguration {
Expand Down Expand Up @@ -59,6 +60,10 @@ class MessageReactionConfiguration {
/// Used for padding to reacted user profile circle.
final EdgeInsets? profileCirclePadding;

/// Maximum number of reaction(emoji) to be visible on a message.
/// Default value is 3.
final int reactionCount;

const MessageReactionConfiguration({
this.reactionsBottomSheetConfig,
this.reactionCountTextStyle,
Expand All @@ -72,6 +77,7 @@ class MessageReactionConfiguration {
this.borderWidth,
this.profileCircleRadius,
this.profileCirclePadding,
this.reactionCount = messageReactionCount,
});
}

Expand Down
1 change: 1 addition & 0 deletions lib/src/utils/constants/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const double replyBorderRadius1 = 30;
const double replyBorderRadius2 = 18;
const double leftPadding3 = 12;
const double textFieldBorderRadius = 27;
const int messageReactionCount = 3;

applicationDateFormatter(DateTime inputTime) {
if (DateTime.now().difference(inputTime).inDays <= 3) {
Expand Down
1 change: 1 addition & 0 deletions lib/src/utils/package_strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ class PackageStrings {
static const String photo = "Photo";
static const String send = "Send";
static const String you = "You";
static const String emptyString = ' ';
}
1 change: 1 addition & 0 deletions lib/src/widgets/image_message_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class ImageMessageView extends StatelessWidget {
children: [
if (isMessageBySender) iconButton,
Stack(
clipBehavior: Clip.none,
children: [
GestureDetector(
onTap: () => imageMessageConfig?.onTap != null
Expand Down
13 changes: 11 additions & 2 deletions lib/src/widgets/reaction_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
*/
import 'package:chatview/src/extensions/extensions.dart';
import 'package:chatview/src/utils/measure_size.dart';
import 'package:chatview/src/utils/package_strings.dart';
import 'package:chatview/src/widgets/reactions_bottomsheet.dart';
import 'package:flutter/material.dart';

import '../../chatview.dart';
import '../utils/constants/constants.dart';

class ReactionWidget extends StatefulWidget {
const ReactionWidget({
Expand Down Expand Up @@ -65,8 +67,10 @@ class _ReactionWidgetState extends State<ReactionWidget> {

@override
Widget build(BuildContext context) {
//// Convert into set to remove reduntant values
//// Convert into set to remove redundant values
final reactionsSet = widget.reaction.reactions.toSet();
final isGroupChat = widget.reaction.reactedUserIds.length > 2;

return Positioned(
bottom: 0,
right: widget.isMessageBySender && needToExtend ? 0 : null,
Expand Down Expand Up @@ -103,7 +107,12 @@ class _ReactionWidgetState extends State<ReactionWidget> {
child: Row(
children: [
Text(
reactionsSet.join(' '),
isGroupChat
? reactionsSet
.take(messageReactionConfig?.reactionCount ??
messageReactionCount)
.join(PackageStrings.emptyString)
: reactionsSet.join(PackageStrings.emptyString),
style: TextStyle(
fontSize: messageReactionConfig?.reactionSize ?? 13,
),
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: chatview
description: A Flutter package that allows you to integrate Chat View with highly customization options.
version: 1.3.1
version: 1.4.0
issue_tracker: https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues
repository: https://github.com/SimformSolutionsPvtLtd/flutter_chatview

Expand Down

0 comments on commit 9ad42b4

Please sign in to comment.