customTextSpan function
Implementation
TextSpan customTextSpan(String message, String prevValue,
TextStyle? normalStyle, TextStyle underlineStyle, bool isClickable) {
return TextSpan(
children: message.split(" ").map((e) {
if (isCountryCode(e)) {
prevValue = e;
} else if (prevValue != Constants.emptyString && spannableTextType(e) == "mobile") {
e = "$prevValue $e";
prevValue = Constants.emptyString;
}
return TextSpan(
text: "$e ",
style: spannableTextType(e) == "text" ? normalStyle : underlineStyle,
recognizer:TapGestureRecognizer()
..onTap = isClickable ? () {
onTapForSpantext(e);
} : null) ;
}).toList(),
);
}