|
|
|
@ -1,4 +1,3 @@
|
|
|
|
import 'package:flutter/gestures.dart';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:collection/collection.dart';
|
|
|
|
import 'package:collection/collection.dart';
|
|
|
|
@ -222,22 +221,31 @@ class MessageTextWidget extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return LinkifySpan(
|
|
|
|
return WidgetSpan(
|
|
|
|
mouseCursor: SystemMouseCursors.click,
|
|
|
|
child: MouseRegion(
|
|
|
|
recognizer: TapGestureRecognizer()
|
|
|
|
cursor: SystemMouseCursors.click,
|
|
|
|
..onTap =
|
|
|
|
child: GestureDetector(
|
|
|
|
onClick != null ? () => onClick?.call(tokenPosition) : null,
|
|
|
|
onTap: onClick != null
|
|
|
|
text: substring,
|
|
|
|
? () => onClick?.call(tokenPosition)
|
|
|
|
style: style.merge(
|
|
|
|
: null,
|
|
|
|
TextStyle(
|
|
|
|
child: RichText(
|
|
|
|
backgroundColor: backgroundColor,
|
|
|
|
text: LinkifySpan(
|
|
|
|
|
|
|
|
text: substring,
|
|
|
|
|
|
|
|
style: style.merge(
|
|
|
|
|
|
|
|
TextStyle(
|
|
|
|
|
|
|
|
backgroundColor: backgroundColor,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
linkStyle: TextStyle(
|
|
|
|
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
|
|
|
|
color: Theme.of(context).colorScheme.primary,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onOpen: (url) =>
|
|
|
|
|
|
|
|
UrlLauncher(context, url.url).launchUrl(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
linkStyle: TextStyle(
|
|
|
|
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
|
|
|
|
color: Theme.of(context).colorScheme.primary,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onOpen: (url) => UrlLauncher(context, url.url).launchUrl(),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if ((i > 0 || i < tokenPositions.length - 1) &&
|
|
|
|
if ((i > 0 || i < tokenPositions.length - 1) &&
|
|
|
|
|