update giphy label

This commit is contained in:
Salvatore Giordano
2020-11-16 16:59:58 +01:00
parent 4ff3a225b2
commit b0cbcbc6c8
+64 -70
View File
@@ -283,80 +283,74 @@ class GiphyAttachment extends StatelessWidget {
Widget _buildSentAttachment(context) { Widget _buildSentAttachment(context) {
return Container( return Container(
child: Column( child: GestureDetector(
children: [ onTap: () {
Container( Navigator.push(context, MaterialPageRoute(builder: (_) {
decoration: BoxDecoration( return FullScreenImage(
borderRadius: BorderRadius.only( url: attachment.imageUrl ??
topRight: Radius.circular(16.0), attachment.assetUrl ??
bottomRight: Radius.circular(0.0), attachment.thumbUrl,
topLeft: Radius.circular(16.0), );
bottomLeft: Radius.circular(16.0), }));
), },
), child: Stack(
clipBehavior: Clip.antiAlias, children: [
child: GestureDetector( CachedNetworkImage(
onTap: () { height: size?.height,
Navigator.push(context, MaterialPageRoute(builder: (_) { width: size?.width,
return FullScreenImage( placeholder: (_, __) {
url: attachment.imageUrl ?? return Container(
attachment.assetUrl ?? width: size?.width,
attachment.thumbUrl, height: size?.height,
); child: Center(
})); child: CircularProgressIndicator(),
),
);
}, },
child: CachedNetworkImage( imageUrl: attachment.thumbUrl ??
height: size?.height, attachment.imageUrl ??
width: size?.width, attachment.assetUrl,
placeholder: (_, __) { errorWidget: (context, url, error) => AttachmentError(
return Container( attachment: attachment,
width: size?.width, size: size,
height: size?.height, ),
child: Center( fit: BoxFit.cover,
child: CircularProgressIndicator(), ),
), Positioned(
); bottom: 8,
}, left: 8,
imageUrl: attachment.thumbUrl ?? child: Material(
attachment.imageUrl ?? color: Colors.black.withOpacity(.5),
attachment.assetUrl, shape: RoundedRectangleBorder(
errorWidget: (context, url, error) => AttachmentError( borderRadius: BorderRadius.circular(12),
attachment: attachment, ),
size: size, child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8.0,
vertical: 4.0,
),
child: Row(
children: [
Icon(
StreamIcons.lightning,
color: Colors.white,
size: 16,
),
Text(
'GIPHY',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 11,
),
),
],
),
), ),
fit: BoxFit.cover,
), ),
), ),
), ],
Padding( ),
padding: const EdgeInsets.only(
top: 8.0,
bottom: 8,
),
child: Row(
children: [
Row(
children: [
Icon(
StreamIcons.lightning,
color: StreamChatTheme.of(context).accentColor,
size: 15.0,
),
Text(
'GIPHY',
style: TextStyle(
color: StreamChatTheme.of(context).accentColor,
fontWeight: FontWeight.bold,
fontSize: 11.0,
),
),
],
),
],
mainAxisAlignment: MainAxisAlignment.start,
),
)
],
), ),
); );
} }