version bump

This commit is contained in:
Salvatore Giordano
2020-05-13 16:54:23 +02:00
parent a1a3cb177d
commit 2de3cc2b69
8 changed files with 188 additions and 47 deletions
+29 -30
View File
@@ -5,7 +5,7 @@ import 'package:stream_chat_flutter/src/attachment_actions.dart';
import '../stream_chat_flutter.dart';
import 'attachment_error.dart';
import 'attachment_title.dart';
import 'utils.dart';
import 'full_screen_image.dart';
class GiphyAttachment extends StatelessWidget {
final Attachment attachment;
@@ -37,39 +37,38 @@ class GiphyAttachment extends StatelessWidget {
children: <Widget>[
Stack(
children: <Widget>[
CachedNetworkImage(
height: size?.height,
width: size?.width,
placeholder: (_, __) {
return Container(
width: size?.width,
height: size?.height,
child: Center(
child: CircularProgressIndicator(),
),
);
GestureDetector(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (_) {
return FullScreenImage(
url: attachment.imageUrl ??
attachment.assetUrl ??
attachment.thumbUrl,
);
}));
},
imageUrl: attachment.thumbUrl ??
attachment.imageUrl ??
attachment.assetUrl,
errorWidget: (context, url, error) => AttachmentError(
attachment: attachment,
size: size,
),
fit: BoxFit.cover,
),
if (attachment.titleLink != null || attachment.ogScrapeUrl != null)
Positioned.fill(
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () => launchURL(
context,
attachment.titleLink ?? attachment.ogScrapeUrl,
child: CachedNetworkImage(
height: size?.height,
width: size?.width,
placeholder: (_, __) {
return Container(
width: size?.width,
height: size?.height,
child: Center(
child: CircularProgressIndicator(),
),
),
);
},
imageUrl: attachment.thumbUrl ??
attachment.imageUrl ??
attachment.assetUrl,
errorWidget: (context, url, error) => AttachmentError(
attachment: attachment,
size: size,
),
fit: BoxFit.cover,
),
),
],
),
if (attachment.title != null)
+4 -9
View File
@@ -74,15 +74,10 @@ class ImageAttachment extends StatelessWidget {
),
),
if (attachment.title != null)
Positioned.fill(
child: Align(
alignment: Alignment.bottomCenter,
child: Material(
child: AttachmentTitle(
messageTheme: messageTheme,
attachment: attachment,
),
),
Material(
child: AttachmentTitle(
messageTheme: messageTheme,
attachment: attachment,
),
),
],
+9
View File
@@ -23,10 +23,19 @@ typedef ThreadBuilder = Widget Function(BuildContext context, Message parent);
typedef ThreadTapCallback = void Function(Message, Widget);
class MessageDetails {
/// True if the message belongs to the current user
bool isMyMessage;
/// True if the user message is the same of the previous message
bool isLastUser;
/// True if the user message is the same of the next message
bool isNextUser;
/// The message
Message message;
/// The index of the message
int index;
MessageDetails(
+6 -3
View File
@@ -188,9 +188,12 @@ class MessageWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final leftPadding = showUserAvatar != DisplayWidget.gone
? messageTheme.avatarTheme.constraints.maxWidth + 22.0
var leftPadding = showUserAvatar != DisplayWidget.gone
? messageTheme.avatarTheme.constraints.maxWidth + 23.0
: 12.0;
if (showSendingIndicator == DisplayWidget.gone) {
leftPadding -= 7;
}
return Portal(
child: Padding(
padding: padding ?? EdgeInsets.all(8),
@@ -428,7 +431,7 @@ class MessageWidget extends StatelessWidget {
onThreadTap: onThreadTap,
showEditMessage: showEditMessage,
showReactions: showReactions,
showReply: showReplyIndicator,
showReply: showReplyIndicator && onThreadTap != null,
),
);
});