add inkwell
This commit is contained in:
@@ -16,6 +16,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
|||||||
|
|
||||||
import 'image_group.dart';
|
import 'image_group.dart';
|
||||||
import 'message_text.dart';
|
import 'message_text.dart';
|
||||||
|
import 'utils.dart';
|
||||||
|
|
||||||
typedef AttachmentBuilder = Widget Function(BuildContext, Message, Attachment);
|
typedef AttachmentBuilder = Widget Function(BuildContext, Message, Attachment);
|
||||||
|
|
||||||
@@ -354,7 +355,9 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
var hostDisplayName =
|
var hostDisplayName =
|
||||||
_getWebsiteName(hostName.toLowerCase()) ?? hostName.capitalize();
|
_getWebsiteName(hostName.toLowerCase()) ?? hostName.capitalize();
|
||||||
|
|
||||||
return Column(
|
return Stack(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
children: [
|
children: [
|
||||||
if (urlAttachment.imageUrl != null)
|
if (urlAttachment.imageUrl != null)
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -373,7 +376,10 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
top: 8.0, left: 8.0, right: 8.0),
|
top: 8.0,
|
||||||
|
left: 8.0,
|
||||||
|
right: 8.0,
|
||||||
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
hostDisplayName,
|
hostDisplayName,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -383,8 +389,9 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius:
|
borderRadius: BorderRadius.only(
|
||||||
BorderRadius.only(topRight: Radius.circular(16.0)),
|
topRight: Radius.circular(16.0),
|
||||||
|
),
|
||||||
color: Color(0xFFE9F2FF),
|
color: Color(0xFFE9F2FF),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -392,7 +399,8 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8.0)),
|
decoration:
|
||||||
|
BoxDecoration(borderRadius: BorderRadius.circular(8.0)),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: widget.textPadding,
|
padding: widget.textPadding,
|
||||||
@@ -420,6 +428,19 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
|
Positioned.fill(
|
||||||
|
child: Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => launchURL(
|
||||||
|
context,
|
||||||
|
urlAttachment.ogScrapeUrl,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user