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 'message_text.dart';
|
||||
import 'utils.dart';
|
||||
|
||||
typedef AttachmentBuilder = Widget Function(BuildContext, Message, Attachment);
|
||||
|
||||
@@ -354,7 +355,9 @@ class _MessageWidgetState extends State<MessageWidget> {
|
||||
var hostDisplayName =
|
||||
_getWebsiteName(hostName.toLowerCase()) ?? hostName.capitalize();
|
||||
|
||||
return Column(
|
||||
return Stack(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
if (urlAttachment.imageUrl != null)
|
||||
SizedBox(
|
||||
@@ -373,7 +376,10 @@ class _MessageWidgetState extends State<MessageWidget> {
|
||||
child: Container(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 8.0, left: 8.0, right: 8.0),
|
||||
top: 8.0,
|
||||
left: 8.0,
|
||||
right: 8.0,
|
||||
),
|
||||
child: Text(
|
||||
hostDisplayName,
|
||||
style: TextStyle(
|
||||
@@ -383,8 +389,9 @@ class _MessageWidgetState extends State<MessageWidget> {
|
||||
),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.only(topRight: Radius.circular(16.0)),
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(16.0),
|
||||
),
|
||||
color: Color(0xFFE9F2FF),
|
||||
),
|
||||
),
|
||||
@@ -392,7 +399,8 @@ class _MessageWidgetState extends State<MessageWidget> {
|
||||
],
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8.0)),
|
||||
decoration:
|
||||
BoxDecoration(borderRadius: BorderRadius.circular(8.0)),
|
||||
),
|
||||
Padding(
|
||||
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