From 2859c257e9e193f7f77c5e5e7318be9bccf17aea Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Fri, 30 Oct 2020 17:58:53 +0530 Subject: [PATCH] removed print and dartfmt --- lib/src/message_reactions_modal.dart | 29 ++++++------- lib/src/reaction_picker.dart | 62 ++++++++++++++-------------- 2 files changed, 46 insertions(+), 45 deletions(-) diff --git a/lib/src/message_reactions_modal.dart b/lib/src/message_reactions_modal.dart index 559e475c..1c3c3e0f 100644 --- a/lib/src/message_reactions_modal.dart +++ b/lib/src/message_reactions_modal.dart @@ -40,13 +40,10 @@ class MessageReactionsModal extends StatelessWidget { var user = StreamChat.of(context).user; var roughMaxSize = 2 * size.width / 3; - var roughSentenceSize = message.text.length * messageTheme.messageText.fontSize * 1.2; + var roughSentenceSize = + message.text.length * messageTheme.messageText.fontSize * 1.2; var divFactor = roughSentenceSize / roughMaxSize; - print(roughMaxSize); - print(roughSentenceSize); - print(divFactor); - return GestureDetector( behavior: HitTestBehavior.translucent, onTap: () { @@ -77,7 +74,11 @@ class MessageReactionsModal extends StatelessWidget { (message.status == MessageSendingStatus.SENT || message.status == null)) Align( - alignment: Alignment(user.id == message.user.id ? (divFactor > 1.0 ? 0.0 : (1.0 - divFactor)) : (divFactor > 1.0 ? 0.0 : -(1.0 - divFactor)), 0.0), + alignment: Alignment( + user.id == message.user.id + ? (divFactor > 1.0 ? 0.0 : (1.0 - divFactor)) + : (divFactor > 1.0 ? 0.0 : -(1.0 - divFactor)), + 0.0), child: ReactionPicker( message: message, messageTheme: messageTheme, @@ -154,10 +155,10 @@ class MessageReactionsModal extends StatelessWidget { alignment: WrapAlignment.start, children: message.latestReactions .map((e) => _buildReaction( - e, - currentUser, - context, - )) + e, + currentUser, + context, + )) .toList(), ), ), @@ -170,10 +171,10 @@ class MessageReactionsModal extends StatelessWidget { } Widget _buildReaction( - Reaction reaction, - User currentUser, - BuildContext context, - ) { + Reaction reaction, + User currentUser, + BuildContext context, + ) { final isCurrentUser = reaction.user.id == currentUser.id; return ConstrainedBox( constraints: BoxConstraints.loose(Size( diff --git a/lib/src/reaction_picker.dart b/lib/src/reaction_picker.dart index e4a8bdf8..e7d302e6 100644 --- a/lib/src/reaction_picker.dart +++ b/lib/src/reaction_picker.dart @@ -28,37 +28,37 @@ class ReactionPicker extends StatelessWidget { borderRadius: BorderRadius.circular(24), ), child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.end, - mainAxisSize: MainAxisSize.min, - children: reactionIcons.map((reactionIcon) { - final ownReactionIndex = message.ownReactions?.indexWhere( - (reaction) => reaction.type == reactionIcon.type) ?? - -1; - return IconButton( - iconSize: 24, - icon: Icon( - reactionIcon.iconData, - color: ownReactionIndex != -1 - ? StreamChatTheme.of(context).accentColor - : Theme.of(context).iconTheme.color.withOpacity(.5), - ), - onPressed: () { - if (ownReactionIndex != -1) { - removeReaction( - context, - message.ownReactions[ownReactionIndex], - ); - } else { - sendReaction( - context, - reactionIcon.type, - ); - } - }, - ); - }).toList(), - ), + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.end, + mainAxisSize: MainAxisSize.min, + children: reactionIcons.map((reactionIcon) { + final ownReactionIndex = message.ownReactions?.indexWhere( + (reaction) => reaction.type == reactionIcon.type) ?? + -1; + return IconButton( + iconSize: 24, + icon: Icon( + reactionIcon.iconData, + color: ownReactionIndex != -1 + ? StreamChatTheme.of(context).accentColor + : Theme.of(context).iconTheme.color.withOpacity(.5), + ), + onPressed: () { + if (ownReactionIndex != -1) { + removeReaction( + context, + message.ownReactions[ownReactionIndex], + ); + } else { + sendReaction( + context, + reactionIcon.type, + ); + } + }, + ); + }).toList(), + ), ); }